开发者

CSS apply style on Html elements for a specific DIV ID

I have this css code but does not work as expected.

My aim is to applying attributes on tags: table tbody tr td on a speific table only.

Do you have a开发者_运维问答n idea what I'm doing wrong? Thanks for your help

#MainContent_uxTreeView table tbody tr td
{
    border-collapse:collapse;
    border-spacing: 0px;
    margin:0px;
    padding:0px;
}


If I understood your problem:

table#MainContent_uxTreeView tbody tr td

If you want the css to be applied to every tag from list, write them separated by comma:

#MainContent_uxTreeView table,
#MainContent_uxTreeView tr,
#MainContent_uxTreeView td
{
}


you only need to do that on the table:

#MainContent_uxTreeView table
{
    border-collapse:collapse;
    border-spacing: 0px;
    margin:0px;
    padding:0px;
}

Side Note if you want to apply the same css rules to multiple selectors, seperate them with a comma

#main,#main1,#main2 {
   ...css rule ...
}


I wrote an answer about similar issue.

Load an external CSS for a specific DIV

You can only use the applyCSSToHTML().

Good luck!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜