| Author |
Image positioning in Firefox
|
|
| Cate Archer 2007-03-24, 7:19 pm |
|
I'm trying to position images using CSS. I put inline style code in
the <img> tag. 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">
| |
|
| Cate Archer wrote:
> I'm trying to position images using CSS. I put inline style code in
> the <img> tag. 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/
| |
| Bergamot 2007-03-24, 7:19 pm |
| Cate Archer wrote:
> I'm trying to position images using CSS. I put inline style code in
> the <img> tag. 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
| |
| Cate Archer 2007-03-24, 7:19 pm |
| On Sat, 24 Mar 2007 17:08:13 +0100, Els <els.aNOSPAM@tiscali.nl>
wrote:
>Try replacing the '=' inside the style attribute with ':'.
That worked. Thanks.
| |
|
| 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/
| |
| Gérard Talbot 2007-03-24, 7:19 pm |
| Cate Archer a écrit :
> On Sat, 24 Mar 2007 17:08:13 +0100, Els <els.aNOSPAM@tiscali.nl>
> wrote:
>
>
> That worked. Thanks.
Cate, please bookmark this page:
Using Web Standards in your Web Pages (Updated Dec. 2006)
http://developer.mozilla.org/en/doc..._your_Web_Pages
That webpage answers the most frequent problems when trying to support
all modern browsers.
Gérard
|
|
|
|
| Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |