给float元素居中
来源:互联网 发布:360压缩mac版 编辑:程序博客网 时间:2024/06/14 00:30
分析
<div class="tc1"> <div class="qd_an_1"> <div> <a href="javascript:void();" id="qin">已签</a></div> <div> <p>07月16日</p> <p>您有<i>1425412</i>金币</p> </div> </div> </div>
.tc1 { float: left; right: -50%; position: relative;}<pre name="code" class="html">.qd_an_1 { background: #fff; border-radius: 5px; padding: 5px; float: left; position: relative; left: -50%;}
<div class="header monospace" style="box-sizing: border-box; font-family: Consolas, 'Lucida Console', monospace; white-space: nowrap; color: rgb(34, 34, 34); widows: 1;"><div class="title styles-selector" style="box-sizing: border-box; cursor: text; word-wrap: break-word; white-space: normal;"><div style="box-sizing: border-box;"><div class="subtitle" style="box-sizing: border-box; color: rgb(85, 85, 85); float: right; margin-left: 5px; max-width: 100%; text-overflow: ellipsis; overflow: hidden; white-space: nowrap;"><a target=_blank class=" webkit-html-resource-link" title="http://csmb.cszhang.ecowe.net/templates/default/css/common_v9.css:6739" data-uncopyable="common_v9.css:6739" style="box-sizing: border-box; color: inherit; text-decoration: underline; cursor: pointer; display: inline-block;"></a></div><span class="selector" style="box-sizing: border-box; color: rgb(136, 136, 136);"><span class="simple-selector selector-matches" style="box-sizing: border-box; color: rgb(34, 34, 34);">.qd_an_1 div</span></span><span style="box-sizing: border-box;"> {</span></div></div></div><ol class="properties monospace" style="box-sizing: border-box; font-family: Consolas, 'Lucida Console', monospace; margin: 0px; padding: 2px 4px 0px 0px; list-style: none; clear: both; color: rgb(34, 34, 34); white-space: nowrap; widows: 1;"><li style="box-sizing: border-box; margin-left: 0px !important; padding-left: 38px; white-space: normal; text-overflow: ellipsis; overflow: hidden; cursor: auto;"><input class="enabled-button" type="checkbox" style="font-family: inherit; font-size: 10px; visibility: hidden; float: left; margin: 0px; vertical-align: top; position: relative; z-index: 1; width: 18px; left: -40px; top: 1px;" /><span class="styles-clipboard-only" style="box-sizing: border-box; display: inline-block; width: 0px; opacity: 0; pointer-events: none; white-space: pre;"> </span><span title="display: block;" style="box-sizing: border-box; color: rgb(200, 0, 0); margin-left: -38px;">display</span>: <span class="expand-element" style="box-sizing: border-box;"></span><span class="value" style="box-sizing: border-box;">block</span>;</li><li style="box-sizing: border-box; margin-left: 0px !important; padding-left: 38px; white-space: normal; text-overflow: ellipsis; overflow: hidden; cursor: auto;"><input class="enabled-button" type="checkbox" style="font-family: inherit; font-size: 10px; visibility: hidden; float: left; margin: 0px; vertical-align: top; position: relative; z-index: 1; width: 18px; left: -40px; top: 1px;" /><span class="styles-clipboard-only" style="box-sizing: border-box; display: inline-block; width: 0px; opacity: 0; pointer-events: none; white-space: pre;"> </span><span title="text-align: center;" style="box-sizing: border-box; color: rgb(200, 0, 0); margin-left: -38px;">text-align</span>: <span class="expand-element" style="box-sizing: border-box;"></span><span class="value" style="box-sizing: border-box;">center</span>;</li><li class="styles-panel-hovered" style="box-sizing: border-box; margin-left: 0px !important; padding-left: 38px; white-space: normal; text-overflow: ellipsis; overflow: hidden; cursor: auto;"><input class="enabled-button" type="checkbox" style="font-family: inherit; font-size: 10px; visibility: hidden; float: left; margin: 0px; vertical-align: top; position: relative; z-index: 1; width: 18px; left: -40px; top: 1px;" /><span class="styles-clipboard-only" style="box-sizing: border-box; display: inline-block; width: 0px; opacity: 0; pointer-events: none; white-space: pre;"> </span><span title="float: left;" style="box-sizing: border-box; color: rgb(200, 0, 0); margin-left: -38px;">float</span>: <span class="expand-element" style="box-sizing: border-box;"></span><span class="value" style="box-sizing: border-box;">left</span>;</li></ol><div style="box-sizing: border-box; color: rgb(34, 34, 34); font-family: Consolas, 'Lucida Console', monospace; white-space: nowrap; widows: 1;">}</div><div class="header monospace" style="box-sizing: border-box; font-family: Consolas, 'Lucida Console', monospace; white-space: nowrap; color: rgb(34, 34, 34); widows: 1;"><div class="title styles-selector" style="box-sizing: border-box; cursor: text; word-wrap: break-word; white-space: normal;"><div style="box-sizing: border-box;"></div></div></div>
.qd_an_1 div {
}
0 0
- 给float元素居中
- float元素居中
- float 元素的水平居中
- html居中的元素带有float属性
- 前端面试题 - 如何居中一个float:left的元素
- 将float元素居中的几种办法
- CSS代码(四):float元素的垂直居中
- css中如何给块元素设置自动居中
- html float居中
- Float 水平居中浮动
- 用position:relative和float实现不定宽块级元素的居中
- 元素居中
- 元素居中
- 元素居中
- 如果用float实现居中
- html和css基础--float属性给父元素带来的问题及方案
- 浮动元素(float)
- 浮动元素(float)
- c_基本概念
- 想越狱的小衫
- APK常用启动方式
- 使用淘宝中间件cobar实现mysql分库分表
- 安装Ubuntu 15.04后要做的事
- 给float元素居中
- 黎万强的《参与感》到底写了什么?
- Keil、uVision、MDK、Keil C51之间的区别比较
- c_分支结构
- ANSI,UTF-8,Unicode,ASCII编码的区别
- Divide Two Integers
- Android HandlerThread 源码分析
- 053第449题
- 不同分辨率的LCM进行兼容