467,915 Members | 1,454 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,915 developers. It's quick & easy.

Image positioning in Firefox


I'm trying to position images using CSS. I put inline style code in
the <imgtag. Why does this line of code work in IE7 but not in
Firefox 2.0? Anybody got a better way?

<img height="160" width="160" style="position=relative; top=20;
left=20;" src="images/bomb.jpg">
Mar 24 '07 #1
  • viewed: 3973
Share:
5 Replies
Els
Cate Archer wrote:
I'm trying to position images using CSS. I put inline style code in
the <imgtag. Why does this line of code work in IE7 but not in
Firefox 2.0? Anybody got a better way?

<img height="160" width="160" style="position=relative; top=20;
left=20;" src="images/bomb.jpg">
Try replacing the '=' inside the style attribute with ':'.

--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/
Mar 24 '07 #2
Cate Archer wrote:
I'm trying to position images using CSS. I put inline style code in
the <imgtag. Why does this line of code work in IE7 but not in
Firefox 2.0? Anybody got a better way?

<img height="160" width="160" style="position=relative; top=20;
left=20;" src="images/bomb.jpg">
"top=20" is invalid for another reason than the one Els mentioned.
Non-zero values require a unit - em, %, px, etc.

I question whether the code you are attempting is really what you
*should* be doing, though. Do you know what relative positioning
actually does?

I bet it "works" (sort of) in IE because you are triggering quirks mode.
How about showing us a URL so we can advise you on the best way to get
what you are really trying to achieve?

--
Berg
Mar 24 '07 #3
On Sat, 24 Mar 2007 17:08:13 +0100, Els <el*********@tiscali.nl>
wrote:
>Try replacing the '=' inside the style attribute with ':'.
That worked. Thanks.
Mar 24 '07 #4
Els
Bergamot wrote:
"top=20" is invalid for another reason than the one Els mentioned.
Non-zero values require a unit - em, %, px, etc.
Yup, missed that one :\

--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/
Mar 24 '07 #5
Cate Archer a écrit :
On Sat, 24 Mar 2007 17:08:13 +0100, Els <el*********@tiscali.nl>
wrote:
>Try replacing the '=' inside the style attribute with ':'.

That worked. Thanks.
Cate, please bookmark this page:

Using Web Standards in your Web Pages (Updated Dec. 2006)
http://developer.mozilla.org/en/docs...your_Web_Pages

That webpage answers the most frequent problems when trying to support
all modern browsers.

Gérard
Mar 24 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by Eric Lindsay | last post: by
5 posts views Thread by Richard Shewmaker | last post: by
16 posts views Thread by Walker | last post: by
1 post views Thread by Jim Moe | last post: by
4 posts views Thread by RE Kochanski | last post: by
3 posts views Thread by seamlyne | last post: by
3 posts views Thread by vunet | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.