CSS怎样设置图片对齐方式

html-css033

CSS怎样设置图片对齐方式,第1张

<html xmlns=" http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/htmlcharset=gb2312" />

<title>无标题文档</title>

<style type="text/css">

#img{text-align:center}

</style>

</head>

<body><div id="img">

<img src="file:///E|/web/baidu_logo.gif" width="270" height="129" />

</div></body>

</html>你可以试试这个方法。我用了ID规则,不会对网页其他地方的图片有影响,也就是说除了使用了这个规则的图片之外,其他的都可以按照你的意愿进行排版。

<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>易宽带卡密系统</title>

<style>

body{margin:0pxpadding:0px}

.body_center{width:900pxheight:600pxmargin:0 auto}

.body_center .logo{width:564pxheight:55pxbackground:url(images/logo.png)}

.body_center .top_right{width:200pxheight:14pxfloat:rightbackground:#C33}

.body_center .top_right em{width:16pxheight:14pxbackground:url(screen.png) no-repeatfloat:left}

.body_center .top_right a{font-size:12pxfloat:leftfont-weight:boldline-height:14px}

</style>

</head>

<body>

<div class="body_center">

<div class="logo"></div>

<div class="top_right">

<em></em>

<a href="#">提取码购买</a>

</div>

</div>

</body>

</html>

input[type="text"]:focus,input[type="searchinput"]:focus

{background:#CCCCCCheight:18px}

没有你这样的写法,应该是

label{background:#CCCCCCheight:18px}