Forum Moderators: not2easy

Message Too Old, No Replies

Positioning Images to the right in Firefox

         

Beerboy

11:22 am on Apr 5, 2005 (gmt 0)

10+ Year Member



Hi guys, this is my first post so be kind.

I'm designing a website in CSS and i have positioned and image to the right like this:

<html>:

<div class="top3"><img src="images/logo3.gif" alt=""></img><img class="cogs" src="images/cogs.gif" alt=""></img></div>

<css>:

.img.cogs {
position: absolute;
right: 0px;
width: 198px;
height: 139px;
}

Ignor the logo3.gif, its the cogs.gif i am having problems with.

In IE6 it works fine, however big the broswer size is, the cogs.gif is alway aligned to the right hand side of the screen. Its firefox which is having the problem, it just puts it next to the logo.

<snip>

You can have a look there to see what i mean.

Does anyone know how i can get Firefox to behiave the same as IE and put the image to the right?

Hope someone can help

Simon

[edited by: engine at 9:50 am (utc) on April 6, 2005]
[edit reason] No urls, thanks. See TOS [webmasterworld.com] [/edit]

Robin_reala

11:33 am on Apr 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A couple of errors I can see straight off:

1) img elements either don't need closing elements (HTML) or are selfclosing (XHTML).

2) In your css you refer to .img.cogs . The '.' infront of the img means elements with class="img". I assume you mean img.cogs?

Beerboy

1:39 pm on Apr 5, 2005 (gmt 0)

10+ Year Member



Thanks, my mistake, i have removed the .img and it now works perfect.

As for the img tag, i dont need to put a </img> at the end?

I'm not sure what u mean by selfclosing (XHTML).

Can u shed some light?

simon

benihana

1:41 pm on Apr 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



while i believe:

<img class="cogs" src="images/cogs.gif" alt=""></img>

is technically ok (someone correct me though...), its generally done:

<img class="cogs" src="images/cogs.gif" alt="" />

Beerboy

1:54 pm on Apr 5, 2005 (gmt 0)

10+ Year Member



Ok, great i'll use that from now on

Regards

Simon