Home > Web Front-end > HTML Tutorial > The difference between # and . in css_html/css_WEB-ITnose

The difference between # and . in css_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:39:53
Original
1304 people have browsed it

The difference between # and . in css

2009-03-04 14:43 fyws Category: Html/Css | Viewed 1911 times

css的#和.的区别如:#home #h3 {  padding-top:0;  padding-bottom:0;  }.pop #h2, .pop #h3 {  position:static;  background:none;  border-width:0;  width:auto;  }其中#和.的区别是什么
Copy after login

Share to:

2009-03-04 14:58

# Heroes vying for hegemony, the team needs you ! #

Asked by

用 # 定义的css 要用 id="home" 来引用用 . 定义的css 要用 class="pop" 来引用像下面#home #h3 表示 id为 home的网页元素 里面的 id为 h3的元素引用 {padding-top:0;padding-bottom:0; }样式<div id="home">   <div id="h3"> 这个div用 #home #h3 样式</div></div><div class="pop>   <div id="h2"> 这个div用 .pop #h2 样式</div></div><div class="pop>   <div id="h3"> 这个div用 .pop #h3 样式</div></div>.pop #h2   和 .pop #h3 是一样的
Copy after login

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