开发者

Using Classes to Style in CSS

开发者 https://www.devze.com 2023-02-12 02:26 出处:网络
I\'ve got a table, and inside of the table areelements. I would like to give the table one class \"chart\" and then style all of theelements that are inside of that table by giving them padding.

I've got a table, and inside of the table are elements. I would like to give the table one class "chart" and then style all of the elements that are inside of that table by giving them padding.

Is this possible?

I was thinking something like...

info.table.td{
    padding:2px;
}

Would be possible, but it does not work :V I know that . is sort of the class operator, but I thought it would make sense开发者_如何转开发 on a tag type as well.


info.table.td means an <info> element with the classes table and td (which is nonsense).

You probably mean table.info td, which means any td that is a child of a table with the class info.


Assuming info is the ID to a container element, try this:

#info table td { padding: 2px; }
0

精彩评论

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