将CSS样式应用于DIV中的所有元素 [英] Applying CSS styles to all elements inside a DIV

查看:319
本文介绍了将CSS样式应用于DIV中的所有元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将CSS文件应用到我的页面中的具体DIV。这是页面结构:

 <链接rel =stylesheet属性HREF =style.css文件/> 
...
< body>
< div id =pagina-pagedata-role =page>
...
< div id =applyCSS>
(这里的所有元素必须遵循一个具体的CSS规则)
< / div>
...
< / body>

我试图应用CSS文件的规则编辑它像这样):

  #applyCSS * {对于applyCSSDIV中的所有元素b $ b .ui-bar-a {
...
...
}
.ui-bar -a .ui-link- inherit {
...
}
...
}

该解决方案不工作。

解决方案

您可以尝试:



< preapplyCSS .ui-bar-a .ui-link-inherit {。属性:值}

Etc,etc ...这是你要找的? p>

I would like to apply a CSS file to a concrete DIV in my page. This is the page structure:

<link rel="stylesheet" href="style.css" />
...
<body>
   <div id="pagina-page" data-role="page">
   ...
   <div id="applyCSS">
      (all the elements here must follow a concrete CSS rules)
   </div>
   ...
</body>

I tried to apply the rules of the CSS file editing it like this (the CSS file is so large):

#applyCSS * {     (For all the elements inside "applyCSS" DIV:)
    .ui-bar-a {
       ...
       ...
    }
    .ui-bar-a .ui-link-inherit {
       ...
    }
    ...
}

But that solution doesn't work. So, how can I do that?

解决方案

You could try:

#applyCSS .ui-bar-a {property:value}
#applyCSS .ui-bar-a .ui-link-inherit {property:value}

Etc, etc... Is that what you're looking for?

这篇关于将CSS样式应用于DIV中的所有元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆