Home  >  Article  >  Web Front-end  >  line-height样式无效,文字不能居中_html/css_WEB-ITnose

line-height样式无效,文字不能居中_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:50:091018browse

line-height样式无效    

这是为什么  捣鼓了好久都没找到原因

<!doctype html><html><head>	<meta charset="utf-8">	<title>淘宝</title>		<link href="images/taobao.jpg" >	<style type="text/css">		*{			margin:0;			padding:0;		}		ul ,li ,a{			margin:0;			padding:0;		}			a{		 			text-decoration:none;			font-size:10px;			color:#333;			}	 		li{			list-style:none;		}		img{			border:none;		}		body{			color:#000;			overflow:hidden;						}					/* 顶部样式 */		.topbg{			background:#eee;			height:35px;		} 		.top{						position:absolute; left:50%; width:1190px; margin-left:-595px;					}		.topleft{			height:35px;			float:left;		}		.topleft li {			display:inline-block;			height:35px;			line-height:35px;		}	</style></head><body>	<!-- 顶部内容 -->	<div class="topbg">		<div class="top">			<ul class="topleft">				<li><a href="#" style="color:red;">亲,请登录</a></li>				<li><a href="#">免费注册</a></li>				<li><a href="#">手机逛淘宝</a></li>				<li><a href="#"><img  src="images/top.gif"/ alt="line-height样式无效,文字不能居中_html/css_WEB-ITnose" ></a></li>			</ul>					</div>			</div>	<!-- 正文部分 -->	<div class="main"></div>	<!-- 底部内容 -->	<div class="bottom"></div></body></html>

  

Statement:
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