I'm trying to position an image using a Stylesheet and an ID. But it doesn't work! I've positioned many Divs this way and it's worked fine. But not images! What am I doing wrong?
Here's the HTML:
And here's the CSS from the Stylesheet:
#para {position: relative;
top: 35px;}
I tried putting the CSS directly into the image tag, and THAT works. But I want to use a stylesheet. Here's the code that works:
Thanks, any help is much appreciated
You should try to avoid
You should try to avoid absolute positioning as much as possible. It leads to all sorts of complications and trouble.
The IMG tag is an inline element and will behave differently than the P element which is block. Give the image in question the rule "display:block;" and see if that helps ny.
didn't help
didn't help
Well if you want really
Well if you want really useful help around here you need to post all your code, not just snippets, and even better than that would be a link to the page that shows the problems.
Time after time we find that the real problem is nowhere near what the poster thinks to be the "relevant" part of the code. Are you using a proper doctype and is both your CSS and your html fully validated against the W3C validators? Invalid code can make things mess up in amazingly strange ways.
In the process of making the
In the process of making the changes required for complete validation, the problem was fixed. I should follow the site rules next time!! :bigoops:
Thanks for helping me out!
well, at least you had the
well, at least you had the sense to follow good advice when it was given! That puts you quite a ways ahead of the average new poster around here, or so it often seems...
Validating a page often has the effect you observed. That's one reason we insist on folks doing it.