applying a class to a div
I have a css which has some attribute as follows:
.ts{
background-image: url("images/xyz/pb.g开发者_开发知识库if");
background-repeat: no-repeat;
padding:0,0,0,20px;
display:none;
}
.ts.visible{
display: inline;
}
Now i want to apply the this style to a div in my html page.How cna i do it.I dont know css
Yep, what they said. Also, if you want to assign more than one class, use a space to separate them, like so: <div class="ts visible">
.
Edit:
Also, use spaces to separate the "padding" values, like this: padding: 0 0 0 20px;
, or just use padding-left: 20px;
.
You can use it like this: <div class="ts">... </div>
But I strongly recommend you take a look at css here, it's not that hard.
Just give that <div>
a class attribute, like this:
<div class="ts"></div>
If you want it to have both classes, use a space between like this:
<div class="ts visible"></div>
You'd simply do:
<div class="ts">Contents of div</div>
That said, I very much suspect that's not the answer you're looking for. :-)
精彩评论