css仅用于div。不是整页 [英] css use only for a div. not entire page

查看:97
本文介绍了css仅用于div。不是整页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

我在页面中写了css代码。在这里我有一个表格控件在div我想这个css只用于这个div而不是整页。



css代码以下



hello
I written css code in a page. In this I have a table control in div I want to that css use only for this div not entire page.

css code following

<style type="text/css"">
 img, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary, time, mark, audio, video
       {
           margin: 0;
           padding: 0;
           border: 0;
           outline: 0;
           font-size: 100%;
           vertical-align: baseline;
           background: transparent;
       }
</style>

推荐答案

用div环绕表标记和名称div为类或id,如
surround the table with a div tag and name that div to a class or id like
并以这种方式访问​​css中的测试类
and access that test class in css


...

如果你的div有 class =''div1''那么



style ...

this way...
if your div have class=''div1'' then

style ...
.div1 img,.div1 ol,.div1 ul.......{...}



快乐编码!

:)


Happy Coding!
:)




你可以使用Class Selector或ID选择器之类的......


you can use Class Selector or ID Selector like....
<style type="text/css"">
div.Mydiv
{
           margin: 0;
           padding: 0;
           border: 0;
           outline: 0;
           font-size: 100%;
           vertical-align: baseline;
           background: transparent;
       }



< / style>

这里Mydiv是你div的class属性............


这篇关于css仅用于div。不是整页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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