CSS不同浏览器排版错位如何解决?
有大师吗?请给我一个演示代码,谢谢!解决方法是:在头部写为
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><html><head><meta charset="utf-8" />
<META http-equiv="Content-Type" content="text/html"><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /><META http-equiv="Cache-Control" content="no-transform"><META http-equiv="Cache-Control" content="no-siteapp"><META content="novel" property="og:type">
<LINK href="css.css" rel="stylesheet" type="text/css">
<title></title></head>
2.在.css中写入:
body {
margin: 0px auto; font-family: "Segoe UI","Lucida Grande",Helvetica,Arial,"Microsoft YaHei",FreeSans,Arimo,"Droid Sans","wenquanyi micro hei","Hiragino Sans GB","Hiragino Sans GB W3",FontAwesome,sans-serif;-webkit-font-smoothing: subpixel-antialiased; -moz-osx-font-smoothing: auto;
}
div {
margin: 0px; padding: 0px; -ms-zoom: 1;
}
ul {
margin: 0px; padding: 0px; -ms-zoom: 1;
}
li {
list-style-type: none;
}
dl {
margin: 0px; padding: 0px; -ms-zoom: 1;
}
dd {
margin: 0px; padding: 0px; -ms-zoom: 1;
}
p {
margin: 0px; padding: 0px; -ms-zoom: 1;
}
h1 {
margin: 0px; padding: 0px; -ms-zoom: 1;
}
h2 {
margin: 0px; padding: 0px; -ms-zoom: 1;
}
h3 {
margin: 0px; padding: 0px; -ms-zoom: 1;
}
h4 {
margin: 0px; padding: 0px; -ms-zoom: 1;
}
.text {
margin: 0px; padding: 0px; -ms-zoom: 1;
}
a {
color: rgb(51, 51, 51); text-decoration: none;
}
a:hover {
color: rgb(253, 85, 0); text-decoration: underline;
}
img {
border: currentColor; border-image: none; 遇到这类问题,一般都是自己解决故障,代码注释
页:
[1]