摘要:
body {font-family:微软雅黑;padding:0;margin:0;font-size:12px;}#wrap {margin-left:auto;margin-right:auto;width:940px;} 阅读全文
摘要:
拖动网页时保持背景不动的CSS样式代码<style> body{background-image:url(logo.gif); background-repeat:no-repeat;background-position:center} </style> 阅读全文
摘要:
Css中实现两个DIV左右并排摆放,且自动按比例伸缩#Div0{float:left;background-color:Blue;width:100%;height:180px;}#Div1{float:left;background-color:Blue;width:70%;height:180px;}#Div2{background-color: Green;width:30%;height:180px;float:right;} 阅读全文
摘要:
li {display: inline-block;line-height:0;}label {display: inline-block;line-height:1.5em;vertical-align:middle;}input {display: inline-block;vertical-align:middle;} 阅读全文
摘要:
我们知道,如果要一个区块水平居中,最好的办法是设置其width,然后使用margin左右为auto,但是对于一个不确定宽度的区块,我们也想要水平居中该怎么办,其实可以设置其display为table,然后设置左右的margin为auto,不过ie6,7不支持display: table;除此之外我们还可以用css3的box-align和box-pack来实现,当然那更不兼容了CSS:.element{display: table;margin:0auto;}因为不兼容,我们得想一个兼容的办法啊,那就是直接用table来构造喽<table class="centered-bloc 阅读全文
摘要:
width:200px;/*设置宽度*/white-space:nowrap;/*设置不折行*/text-overflow:ellipsis;/*这就是省略号喽*/-o-text-overflow:ellipsis;/*兼容opera*/overflow:hidden;/*设置超过的隐藏*/ 阅读全文
摘要:
表格线常见问题:1.表格边框与的重叠。[采用border-collapse:collapse解决]2.嵌套表格与被嵌套表格边线重叠问题。[采用border-top|left|right|bottom解决]3.嵌套表格与被嵌套表格对不齐的问题。[采用table-layout: fixed;解决] 阅读全文