用css 如何设置页面居左

用css 如何设置页面居左代码如下/* 1. ++++++++++++++++ RESET ++ */css_html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{font-size:100%;vertical-align:baseline;border:0;outline:0;background:transparent;margin:0;padding:0}ol,ul{list-style:none}blockquote,q{quotes:none}:focus{outline:0}table{border-collapse:collapse;border-spacing:0}br.clear{clear:both}.clearfix:after{content:".";display:block;height:0;clear:both;visibility:hidden}.clearfix{display:inline-block}* html .clearfix{height:1%}img#wpstats{width:0;height:0;overflow:hidden}.hide,hr{display:none}/* 2. ++++++++++++++++ TEXT ++ */body{font:12px/1.5 Georgia,Baskerville,Palatino,Times;;background: #fff; color:#696969; border-top:9px solid #e7e4e1;}

用css 设置页面居左,首先我们需要写好一个div然后设置好它的宽高,然后在使用margin来操作,使它距离浏览器的左边为0就行了,marign的用法如图:

添加一个border方便观察,具体看代码:

<html>

<head>

<style>

.div1{                    

width:600px;

height:200px;

font-size:13px;

border:1px solid #f00;

margin:0px;

}

</head>

<body>

<div class='div1'>

<p>我是测试文字</p>

</div>

</body>

</html>

温馨提示:答案为网友推荐,仅供参考
第1个回答  2012-02-21
我给你一个全局吧
/*------全局------*/
body,hr, p, blockquote, dl, dt, dd, ul, ol, li, pre, form, fieldset, legend, button, input, textarea, th, td,label{margin:0; padding:0;}
body{font:12px/1.5 tahoma, arial, \5b8b\4f53;}
h1, h2, h3, h4, h5, h6{ font-size:12px; font-weight:normal;}
ul, ol{list-style:none;}
a{ text-decoration:none;}
fieldset, img {border:none;}
.clear{ clear:both;}
第2个回答  推荐于2016-02-09
内容这个乱。

浮动居左float:left;
内容居左text-align:left;本回答被提问者采纳
第3个回答  2012-02-20
只有css,html呢?
第4个回答  2012-02-19
margin-left:0px;

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网