css实现两边对齐
2011-10-08 16:20
92 查看
<!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>无标题文档</title> <style type="text/css"> *{ margin:0px; padding:0px;} ul,li{ list-style:none;} img{ border:0px;} li{ float:left;} .xl_hot{ border:1px solid blue; width:960px; overflow:hidden; margin:100px auto; padding:10px 0px;} .xl_hot li{ margin-left:20px; display:inline; width:223px; border:1px solid red; height:223px;} .xl_hot ul{ margin-left:-20px;} </style> </head> <body> <div class="xl_hot"> <ul> <li></li> <li></li> <li></li> <li></li> </ul> </div> </body> </html>在ie6下,会出现错位,修改.xl_hot ul{ margin-left:-20px; zoom:1}即可。
相关文章推荐
- 怎样用CSS来实现网页文字的两边对齐
- CSS实现让同一行文字和输入框对齐的方法
- CSS笔记---文字两边对齐
- CSS布局之div交叉排布与底部对齐--flex实现
- CSS基础篇--html 空格符号 nbsp; ensp; emsp; 介绍以及实现中文对齐的方法
- 用css实现图片与文字底边对齐[转帖]
- css span右对齐 css li标签中span日期靠右布局实现代码
- CSS实现图片文字对齐
- CSS实现多行文字两端对齐的效果
- css简洁代码实现 两端对齐
- css实现文字指定位置显示,底部对齐,文字在块内的垂直对齐
- CSS伪类实现中间文字两边横线效果
- css实现文字一行居中,多行左对齐
- css实现两端对齐的3种方法
- css实现图片与文字底边对齐
- CSS实现同一行的图片和文字垂直居中对齐的方法
- CSS实现两端对齐效果
- CSS 实现文字、图片垂直对齐(vertical-align)
- CSS实现让同一行文字和输入框对齐的方法
- 【原】css实现两端对齐的3种方法