Home > Web Front-end > HTML Tutorial > margin:0px;后面加【】为什么能调整排版?body>div这句代码是什么意思?_html/css_WEB-ITnose

margin:0px;后面加【】为什么能调整排版?body>div这句代码是什么意思?_html/css_WEB-ITnose

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-21 09:21:33
Original
1583 people have browsed it

@charset "utf-8";/* CSS Document */*{	margin:0px;\	padding:0px;}body{	background-image: url(../images/bg.jpg);	background-repeat:repeat-x;	height:1000px;	}body>div{	width:900px;}#wrap{	margin:0 auto;}#header{	height:80px;	background:#fff;}#hl{	width:550px;	height:80px;	background:#fff;	background-image: url(../images/logo.jpg);	background-repeat: no-repeat;	float:left;	}#hr{	float:right;	font-size:8px;}#nav{	background-image: url(../images/dh.jpg);	height:30px;	border:solid #fff 5px;	border-width: 0px 0px 5px 0px;}#logo{	height:300px;	background-image: url(../images/1.jpg);}#main{	height:400px;	margin-top: 5px;}#ml{	height:400px;	width:250px;	background-image: url(../images/left.jpg);	margin-right: 5px;	float:left;}#mr{	height:25px;	width:645px;	float:right;	color:blue;}#gsjj{	background:blue;	font-family:"Microsoft YaHei";	font-size: 10px;	color:#fff;	font-weight: normal;}#footer{	margin-top: 10px;	border:solid 1px blue;	border-width: 1px 0px 0px 0px;	text-align:center;}ul li{	width:100px;	height:30px;	float:left;	color:#fff;	list-style-type:none;	padding-top: 5px;	padding-left: 5px;}
Copy after login
Copy after login


回复讨论(解决方案)

CSS element>element 选择器

CSS element>element 选择器



margin:0px;\

这个的最后的符号怎么理解?


CSS element>element 选择器



margin:0px;\

这个的最后的符号怎么理解?


没这种写法吧
http://baike.baidu.com/view/1119452.htm?fr=aladdin



CSS element>element 选择器



margin:0px;\

这个的最后的符号怎么理解?


没这种写法吧
http://baike.baidu.com/view/1119452.htm?fr=aladdin


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>index</title><link href="css/index.css" rel="stylesheet" type="text/css" /></head><body><div id="wrap">  <div id="header">  <div id="hl"></div>  <div id="hr">设为主页|加入收藏</div>  </div>  <div id="nav">    <ul>    <li>首页</li>    <li>公司简介</li>    <li>新闻中心</li>    <li>工程展示</li>    <li>企业管理</li>    <li>业务范围</li>    <li>在线留言</li>    <li>关于我们</li></ul>  </div>  <div id="logo"></div>  <div id="main"><div id="ml"></div>  <div id="mr"><div id="gsjj"><h1>公司简介</h1></div>selector {font-family:"Microsoft YaHei",微软雅黑,"Microsoft JhengHei",华文细黑,STHeiti,MingLiu}之所以加上中文名“微软雅黑”是为了兼容opera。Microsoft JhengHei为微软正黑体,CSS控制字体颜色 [问题点数:40分,结帖人T_long] 快速回复 只显示楼主 关注帖子 CSS控制字体颜色 [问题点数:40分,结帖人T_long] 收藏 ...bbs.csdn.net/topics/35... 2010-09-06  - 百度快照 - 89%好评css 字体颜色问题_百度知道2个回答 - 提问时间: 2010年05月23日最佳答案: 连接样式: a:link,a:hover,a:visited{color:Pink!important} 改背景,不知道你说的是哪个背景,是整体背景的话可以放在body里 body{background:url()}...zhidao.baidu.com/link?... 2010-05-26  - 百度快照 - 87%好评css的字体颜色有哪些_百度知道4个回答 - 提问时间: 2014年10月24日CSS中的字体颜色有两种表示方式,分别是: 1,颜色名,比如:color:white; 2,RGB,比如color:rgb(255,255,255); 3,16进制,比如color:#fff; 除第一种表示很有限...STHeiti为华文黑体,MingLiu记得11px下的中文有着不凡的效果。</div></div>  <div id="footer"><h5>Copyright 版权所有 珠海市劳务有限公司</h5></div></div></body></html>
Copy after login


@charset "utf-8";/* CSS Document */*{	margin:0px;\	padding:0px;}body{	background-image: url(../images/bg.jpg);	background-repeat:repeat-x;	height:1000px;	}body>div{	width:900px;}#wrap{	margin:0 auto;}#header{	height:80px;	background:#fff;}#hl{	width:550px;	height:80px;	background:#fff;	background-image: url(../images/logo.jpg);	background-repeat: no-repeat;	float:left;	}#hr{	float:right;	font-size:8px;}#nav{	background-image: url(../images/dh.jpg);	height:30px;	border:solid #fff 5px;	border-width: 0px 0px 5px 0px;}#logo{	height:300px;	background-image: url(../images/1.jpg);}#main{	height:400px;	margin-top: 5px;}#ml{	height:400px;	width:250px;	background-image: url(../images/left.jpg);	margin-right: 5px;	float:left;}#mr{	height:25px;	width:645px;	float:right;	color:blue;}#gsjj{	background:blue;	font-family:"Microsoft YaHei";	font-size: 10px;	color:#fff;	font-weight: normal;}#footer{	margin-top: 10px;	border:solid 1px blue;	border-width: 1px 0px 0px 0px;	text-align:center;}ul li{	width:100px;	height:30px;	float:left;	color:#fff;	list-style-type:none;	padding-top: 5px;	padding-left: 5px;}
Copy after login
Copy after login


去掉那个符号后,会产生不同的效果。

加了那个后padding无效了

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