开发者

How to apply css label for only a specified class

I'm trying to make the first label bold (row 1) and then the second one (row 2) not use the div.row label declaration. How would I do that? I was thinking that by doing div.row label it will only applied to all the label in开发者_JAVA百科side a div class="row"

div.row label{
    font-weight: bold;
}

<div class="row"><label>row 1</label> : <input type="text"/></div>
<div><label>row 2</label> : <input type="text"/></div>


Depending on how variable your structure is, you can use div.row:first-child { /css here/ } or div.row:nth-child(n) { /css here/ } to select the elements within the div of the chosen class

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜