html+css3学习小结

1.如果想要把div块居中,要先定义DIV的宽度,再设置外边距margin属性的左右边距为auto即可。此时DIV便会相对于它的父容器水平居中。text-align文字居中,加上line-height:100px;可文字上下居中。

如下:margin:100px  auto;width:960px;background:#999;text-align:center;height:100px;line-height:100px;

2.<input type="checkbox">游泳</input>  input选择框只能点击选择框才能勾选。如果想实现点击文字就能勾选,用label标签包起来就能行了。如:<label><input type="checkbox">游泳</input></label>

猜你喜欢

转载自z1414644039.iteye.com/blog/2410136