css居中的一些问题,我觉得有点用处,先收藏起来啦!

css字体居中是怎么弄的呢?


回答:单行的话设置line-height,多行的话用padding。


div+cssli垂直居中是怎么弄?


复制下面代码去看下,研究下,就会懂啦。


body{


margin:0px0px0px0px;


padding:0px0px0px0px;


font-family:verdana,arial,helvetica,sans-serif;


color:#c060;


background-color:#CCC;


text-align:center;


/*part1of2centeringhack*/


}


#content{


width:400px;


padding:10px;


margin-top:20px;


margin-bottom:20px;


margin-right:auto;


margin-left:auto;


/*operadoesnotlike'margin:20pxauto'*/


background:#FFF;


border:5pxsolid#666;


text-align:left;


/*part2of2centeringhack*/


width:400px;/*ie5winfudgebegins*/


voice-family:"\\"}\\"";


voice-family:inherit;


width:370px;


}


html>body#content{


width:370px;/*ie5winfudgeends*/


}


CSS在IE6下背景图片居中是怎么弄的呢?


这个,可以在cs3里面,直接可以弄好的,点击一下居中的按钮就行了。


CSS图片垂直居中是怎么弄呢?


复制这个代码去看下,就知道啦。


<styletype="text/css">


li{height:60px;}


liimg{height:50px;margin-top:5px;margin-bottom:5px;}


</style>


<liheight=50><imgsrc=http://cache.soso.com/wenwen/i/wenwen_logo.gif/></li>


<li><imgsrc=http://cache.soso.com/wenwen/i/wenwen_logo.gif/></li>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值