文章出處
文章列表
//這個可以作為補白居中的替補方法
<!doctype html> <html> <head> <meta charset="utf-8"> <title>無標題文檔</title> </head> <body> <style> *{ margin:0; padding:0; } div{ position:relative; width:50%; height:100px; background:#ccc; } div ul{ /*這幾個屬性缺一不可*/ position:relative; left:50%; float:left; } li{ list-style:none; } div ul li{ /*這幾個屬性缺一不可*/ float:right; position:relative; right:50%; } </style> <div> <ul> <li>111</li> <li>111</li> <li>111</li> <li>111</li> <li>111</li> </ul> </div> 此法可以作為居中的一種方式 </body> </html>
IE6無法設置到某個最小高度 : so ==〉height:0;background:#f00;overflow:hidden;<===overflow:hidden;
這樣子也行:overflow:hidden; zoom:0.8; line-height:1px
display: -moz-inline-stack; display: inline-block; zoom: 1; *display: inline; width:100px; height:200px; background:#f00; margin:10px;
//顧名思義,讓行間元素也具有width和height;padding,margin 等等, ie6必須使用zoom觸發haslayout,然后接著使用display:inline,就可以了
// <![CDATA[ 這里面些代碼,這樣在XHTML下就可以看到到底是哪里不符合xhtml的規范了; // ]]>
<!--[if !IE]>除IE外都可識別<![endif]-->
<!--[if IE]> 所有的IE可識別 <![endif]-->
讓文本和check等等input旁邊的文本全部居中對齊;這個vertical-align是加載input上面,而不是加載父級上面的 <div> <input style="vertical-align:middle;height:200px" value="xx" type="text"/> <span>sdfsdf</span>sdfsdf <input type="checkbox"> </div>
//讓圖片旁邊的字居中也是一樣的
<img src="../4.21/201308251443258587.gif" style="vertical-align:middle" /> 11111
<img src="static/img/xyx.jpg" align="middle"/> 11111
//讓超出去的變成...
white-space:nowrap; text-overflow:ellipsis; overflow:hidden; display:block
//把超出去的折行 word-wrap:break-word;overflow:hidden
文章列表
全站熱搜