CSS问题总结(持续更新)

Q:textarea中auto属性无效。

A:因textarea是行内元素,width属性无效,只有将其转化为块级元素才会生效,只需给其增加"display:block;"即可。

 

Q:div中"margin:0 auto;"无效。

A:可能为div设置了position属性,只能使用left/top/right/bottom改变其位置。

 

Q:div中"margin-right:;"无效。

A:浏览器默认从左往右渲染元素,在没有超出父容器的宽度的前提下,如果子容器的宽度能够被容纳,设置margin-right是没有用的,可加"float:right;"属性。

posted @ 2016-07-15 10:31  浅书流年  阅读(134)  评论(0编辑  收藏  举报