브라우저 기본 스타일을 덮어쓰고user agent stylesheet의 영향을 제거합니다.

1185 단어 CSS
웹 페이지를 디자인하여 자신의 css 효과를 볼 때 때때로 자신이 쓴 스타일이 작용하지 않는다는 것을 발견할 수 있습니다. 스타일을 살펴보니 사용자 에이전트 스타일시트의 스타일이 우리가 쓴 스타일을 덮어씌웠습니다. 사용자 에이전트 스타일시트는 브라우저의 기본 스타일이고 브라우저의 css 스타일은 우리의 html을 과장했기 때문에 이런 문제가 발생했습니다.그래서 우리가 프론트 데스크톱 페이지를 쓸 때 먼저 프론트 데스크톱 페이지를 초기화하는 것은 좋은 습관이다.
브라우저 스타일의 초기화 코드를 지우려면 다음과 같이 하십시오.
html{color:#000;background:#FFF;}   
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,   
fieldset,input,textarea,p,blockquote,th,td {   
margin:0;   
padding:0;   
}   
table{   
border-collapse:collapse;   
border-spacing:0;   
}   
fieldset,img {   
border:0;   
}   
address,caption,cite,code,dfn,em,strong,th,var {   
font-style:normal;   
font-weight:normal;   
}   
ol,ul {   
list-style:none;   
}   
caption,th {   
text-align:left;   
}   
h1,h2,h3,h4,h5,h6 {   
font-size:100%;   
font-weight:normal;   
}   
q:before,q:after {   
content:'';   
}   
abbr,acronym { border:0;   
}   
@charset "utf-8";  
*{  
    margin: 0px;  
    padding: 0px;  
      
}   
a{  
    text-decoration: none;  
    color: #000000;  
    font-size:15px;  
    /*  */  
}  
li{  
    list-style: none;  
}  
input,img{  
    border: none;  
}

좋은 웹페이지 즐겨찾기