English 中文(简体)
CSS /超负荷儿童是否高于父母?
原标题:Do CSS / HTML children override parents?

根据以下法典:

<div id="bla">
    <p class="blubber">Johnny Bananas</p>
</div>

and the style in head of that html doc:

<style>
    div#bla{background:yellow}
    p.blubber{background:purple}
</style>

为什么孩子们会被带上彩色的包裹,并且会把孩子的父母推过来?

最佳回答

<条码>后天线 财产不因儿童违约而继承。 因此,<代码>div#bla<>/code>不适用于<代码>p.blubber和p.blubber,可单独具体说明其背景,而不论具体性。

自<条码>后 不是继承的,实际上就没有压倒一切。

问题回答

当使用多种风格说明时,风格说明会争夺特定选择者的控制权。 在这些情况下,必须制定办法规则。 以下特点将决定相互矛盾的风格。

http://htmlhelp.com/vis/css/structure.html

由于具体情况相同,因此该规则将适用于<代码>p要素。 如果您删除<代码>p,而仅填上.blubber,则该代码应为t work。

另外,如果内容更多,孩子可以 overrid倒父母,请见p(div>上的黄色。

在特别安全局中,没有并继承背景。





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签