clankill3r
clankill3r

Reputation: 9553

css selector fails with 'id class img'

I'm wondering why the following selector won't work.

The html:

<div id="commissie">
    <img class="logo" src="http://www.dalcanton.it/tito/code/alcaze/foobar.png">
 </div>

The css:

#commissie .logo img  {
    margin-top: 100px;
}

So simple as that, can someone tell?

Upvotes: 1

Views: 60

Answers (2)

Yuva Raj
Yuva Raj

Reputation: 3881

You're doing mistake at here,

#commissie .logo img

Change this to,

#commissie img.logo 
{
margin-top: 100px;
}

Before :

enter image description here

AFTER:

enter image description here

Upvotes: 1

Kheema Pandey
Kheema Pandey

Reputation: 10275

You are using it in wrong manner. .logo class is used for img.

use like this.

#commissie img.logo {
    margin-top: 100px;
}

Upvotes: 6

Related Questions