当前位置:编程学习 > html/css >>

css 浮动元素居中实现方法

<title>浮动元素居中</title>
<style type="text/css教程">
<!--
#hezi {
           position:absolute;
       left:50%;
       top: 50%;
       
}
.s_cell {
       float:left;
       position:relative;
       right:50%;
       bottom: 50%;
       background: red;
}
-->
</style>
<meta http-equiv="content-type" content="text/html; charset=gb2312"></head>
<body>
<div id="hezi">
<div class="s_cell">
    <span class="font_style">浮动元素内容1浮动元素内容1浮动元素内容1浮动元素内容1</span>
</div>
</div>

补充:Css教程,高级应用 
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,