By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,395 Members | 1,882 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,395 IT Pros & Developers. It's quick & easy.

Image positioning in Firefox

P: n/a

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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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.