I am really new to HTML and was wondering how you center multiple links with html?
I have been trying :
<a href="http//www.google.com"><p style="text-align:center">Search</a>
But the problem is when I try to put other links behind it for example:
<a href="http//www.google.com"><p style="text-align:center">Search</a><a href="Contact Us"><p style="text-align:center">Contact Us</a></p>
It just places them on separate lines. I believe this is happening because of the <p> function…but I only know HTML, I know you can do it in CSS but I was wondering if it can be done using just HTML.
Thanks for any help!
there are some mistakes in your code – the first: you havn’t closed you
p-tag:next:
pstands for ‘paragraph’ and is a block-element (so it’s causing a line-break). what you wanted to use there is aspan, wich is just an inline-element for formatting:but if you just want to add a style to your link, why don’t you set the style for that link directly:
in the end, this would at least be correct html, but still not exactly what you want, because
text-align:centercenters the text in that element, so you would have to set that for the element that contains this links (this piece of html isn’t posted, so i can’t correct you, but i hope you understand) – to show this, i’ll use a simplediv:EDIT: some more additions to your question:
pis not a ‘function’, but you’re right, this is causing the problem (because it’s a block-element)