CSS

mac2022-06-30  87

//这个可以作为补白居中的替补方法<!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

  

 

转载于:https://www.cnblogs.com/diligenceday/p/3689285.html

最新回复(0)