摘要: body {font-family:微软雅黑;padding:0;margin:0;font-size:12px;}#wrap {margin-left:auto;margin-right:auto;width:940px;} 阅读全文
posted @ 2013-05-27 19:41 萌小孩 阅读(94) 评论(0) 推荐(0) 编辑
摘要: 拖动网页时保持背景不动的CSS样式代码<style> body{background-image:url(logo.gif); background-repeat:no-repeat;background-position:center} </style> 阅读全文
posted @ 2013-05-27 19:40 萌小孩 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 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;} 阅读全文
posted @ 2013-05-27 19:39 萌小孩 阅读(2547) 评论(0) 推荐(0) 编辑
摘要: 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;} 阅读全文
posted @ 2013-05-27 19:27 萌小孩 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 我们知道,如果要一个区块水平居中,最好的办法是设置其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 阅读全文
posted @ 2013-05-27 19:26 萌小孩 阅读(248) 评论(0) 推荐(0) 编辑
摘要: width:200px;/*设置宽度*/white-space:nowrap;/*设置不折行*/text-overflow:ellipsis;/*这就是省略号喽*/-o-text-overflow:ellipsis;/*兼容opera*/overflow:hidden;/*设置超过的隐藏*/ 阅读全文
posted @ 2013-05-27 19:23 萌小孩 阅读(480) 评论(0) 推荐(0) 编辑
摘要: 表格线常见问题:1.表格边框与的重叠。[采用border-collapse:collapse解决]2.嵌套表格与被嵌套表格边线重叠问题。[采用border-top|left|right|bottom解决]3.嵌套表格与被嵌套表格对不齐的问题。[采用table-layout: fixed;解决] 阅读全文
posted @ 2013-05-27 19:08 萌小孩 阅读(670) 评论(0) 推荐(0) 编辑
摘要: placeholder是html5中的表单占位符,支持text,password及textarea等html5中新增的表单元素。既然是html5,那么当然只有高级浏览器可以支持了,不过没关系我们可以借用jquery插件来帮我们来解决这个兼容问题如何使用使用方法很简单,先加载一个jquery库,然后就是加载这个插件的js,最后就是使用了,在页面调用如下jsJs Code<script type="text/javascript">$(function() { $('input, textarea').placeholder();});</sc 阅读全文
posted @ 2013-05-25 12:49 萌小孩 阅读(1155) 评论(0) 推荐(0) 编辑