网页中编码上方有空白的解决方法

作者:国际小甜 | 创建时间: 2023-05-01
初学者,编写页面时常常会发现顶部有空白,而你设置的padding值和margin值都是0...
网页中编码上方有空白的解决方法

操作方法

只需要在css中加入全局属性即可解决 代码如下:

@charset "utf-8";body,td,th { font-family: Arial, Helvetica, sans-serif; font-size: 12px;}body { margin: 0px; padding: 0px;}*{margin:0;padding:0;list-style-type:none;}a,img{border:0;}a { color: #333333;}a:link { text-decoration: none;}a:visited { text-decoration: none; color: #333333;}a:hover { text-decoration: none; color: #0066CC;}a:active { text-decoration: none; color: #333333;}

完美解决,通用的全局属性

点击展开全文

更多推荐