Buddy Log
Buddy Log

Reputation: 29

Making an image float right in CSS?

Does anyone know why the following code isn't working: The image remains towards the left of the screen.

HTML:

<div class"footerimg">
  <img src="./img/logo2.png" width="100px;" height="100px;">
</div>

CSS:

.footerimg {
  float:right;
}

Additional Info: This div is inside another div called footer, but that shouldn't affect anything should it? The CSS file IS linked to the page, I have started the style the footer.

Upvotes: 0

Views: 62

Answers (2)

Jonas Libbrecht
Jonas Libbrecht

Reputation: 777

try this:

footerimg>img{float:right;}

and add this in your html code:

class="footerimg"

you forgot the '='

Upvotes: 0

NoobEditor
NoobEditor

Reputation: 15871

error :

<div class"footerimg">

should be

<div class = "footerimg">
       __^^^^__missing equal sign  

Upvotes: 1

Related Questions