Home > Web Front-end > HTML Tutorial > CSS问题_html/css_WEB-ITnose

CSS问题_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:26:56
Original
984 people have browsed it

我看别人写CSS代码的时候

.one{color};.one .two{color}
Copy after login


为什么这样写啊?看起来可以直接写那个类啊,是因为继承吗
求各位大神指点。


回复讨论(解决方案)

.one{color}这是设置one类自身的样式
.one .two{color}这是设置在one类元素内的two类的样式

表示 DOM 中元素的层次关系

.one{color}这是设置one类自身的样式
.one .two{color}这是设置在one类元素内的two类的样式


作用是什么?

.one下的 "class=tow" 的样式设置

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template