Hi this is another issue I am having difficulty with;
How do I align (I want to center horizontally) the image and the text on a link.
<li><a href=“XYZ”><img src=“XYZ” alt=“XYZ”<h1>XYZ</h1></a></li> so that the title “h1” appears vertically centered with the image.
Now the h1 is appearing bellow the imagge no matter what I try.
Sorry it’s the first time I mess around with web design (or any other programing) so I certainly doing lots of basic mistakes.
Actually I am doing a navigation menu, with 2 columns and 3 links per column.
Each link has an image (linking to page) and an h1 text (also linking to page).
When I see the links, I have the image on top and the h1 text under, what I want is to have the image on the left of the text, and the h1 text at the right of the photo and centered vertically. (not at the bottom of the image).
You should do it like this although I would actually lose the heading element as this is not a heading really (and it certainly isn’t an h1 as there should only be one H1 per page).
The code sample you gave is complete gibberish I am afraid to say… You have block level elements within inline elements and malformed syntax. I assume you were trying to write the following:
Although I am not sure why you wanted it within a list and are you sure you didn’t want the h1 text within a hyperlink?
You might have to rephrase the question because in one instance you are saying vertical and the other horizontal. Unless you mean you want a horizontally centred H1 with a image directly centred below it.