Reputation: 8487
I want to select a div whose class = "c" & id = "i"
:
.c
{
color: red;
border:1px;
font-size:25px;
background-color: yellow;
width:200px;
}
<div id="i" class="c">change</div>
now how can i change only the width from class="c" properties for this div?
Upvotes: 2
Views: 78
Reputation: 8701
You can do something like this:
.c#i { width:400px }
This changes the width of the div with class c
AND id i
Upvotes: 3
Reputation: 382909
now how can i change only the width from class="c" properties for this div?
To select a div with class c
:
div.c {width: yourValue;}
To change a div with class c
AND id i
:
.c#i {width: yourValue;}
Upvotes: 1