关于Html无宽度居中
?
代码:
<!DOCTYPE html><html><head> <meta charset="utf-8"> <title></title> <style type="text/css"> body{font-size: 12px;background: ;} ul{margin: 0;padding: 0;list-style: none; clear:both; position: relative;float:left; left: 50% } li{float: left;display: inline;position: relative;left: -50%;margin: 5px 0} .wrapper a{display: block;height: 20px;width: 20px;text-decoration: none;text-align: center;line-height: 20px;color: #fff;background: blue;float: left;margin: 0 5px;} </style></head><body> <div class="wrapper"> <ul><li><a href="#">1</a> </li></ul> <ul> <li><a href="#">1</a></li> <li><a href="#">2</a></li> <li><a href="#">3</a></li></ul> <ul> <li><a href="#">1</a></li> <li><a href="#">2</a></li> <li><a href="#">3</a></li> <li><a href="#">4</a></li> <li><a href="#">5</a></li> </ul> </div></body></html>
?效果:
112312345