CSS style reset and clear (to make different browsers display the same effect)

CSS style reset and clear (to make different browsers display the same effect)
In order to make the page display consistent between different browsers, CSS style clearing and resetting is a must for front-end development. Based on previous experience, we have compiled a CSS reset style code for reference.

Copy code
The code is as follows:

@charset "utf-8";
body, h1, h2, h3, h4, h5, h6, hr, p, blockquote, pre,
dl, dt, dd, ul, ol, li, th, td, div, span, img,
fieldset, lengend, button, input, select, textarea{margin: 0;padding: 0;}
/* color & background */
html{color:#000; background:#FFF;}
/* font */
body, button, input, select, textarea { /* for ie */
font: 12px/18px Arial, Verdana, Microsoft YaHei;
}
/* fix center */
html,body {height: 100%;margin: 0 auto;}
/* h1~h6 */
h1 {font-size: 18px;}
h2 {font-size: 16px;}
h3 {font-size: 14px;}
h4, h5, h6 {font-size: 100%;}
/* a */
a { text-decoration: none; }
a:hover { text-decoration: underline; }
/* list */
ul,ol {list-style: none;}
/* img border */
fieldset,img{border: 0}
/* table */
table {border-collapse: collapse;border-spacing: 0;font:inherit;}
/* margin */
.alpha {margin-left: 0;}
.omega {margin-right: 0;}
/* float & clear */
.left{float:left;}
.right{float:right;}
.clear {clear: both;display: block;}
/* clearfix */
.clearfix:after{content:".";display:block;}
.clearfix{display:inline-table;}
/* Hides from IE-mac */
* html .clearfix{height:1%;}
.clearfix{display:block;}
/* End hide from IE-mac */
*+html .clearfix{min-height:1%;}/* IE7 */

<<:  Using shadowsocks to build a LAN transparent gateway

>>:  Vue3+Vite+TS implements secondary encapsulation of element-plus business components sfasga

Recommend

Xftp download and installation tutorial (graphic tutorial)

If you want to transfer files between Windows and...

js realizes two-way data binding (accessor monitoring)

This article example shares the specific code of ...

Two methods to implement Mysql remote connection configuration

Two methods to implement Mysql remote connection ...

Do you know how to use mock in vue project?

Table of contents first step: The second step is ...

UDP simple server client code example

I won’t go into details about the theory of UDP. ...

Nginx 502 Bad Gateway Error Causes and Solutions

I have encountered the Nginx 502 Bad Gateway erro...

Detailed explanation of publicPath usage in Webpack

Table of contents output output.path output.publi...

JavaScript to achieve product query function

This article example shares the specific code of ...

Summary of Vue's common APIs and advanced APIs

Table of contents nextTick Mixins $forceUpdate se...

Docker container connection implementation steps analysis

Generally speaking, after the container is starte...

Some small methods commonly used in html pages

Add in the <Head> tag <meta http-equiv=&q...

Bugs encountered when using mybatis-generator with mysql8.0.3 in IDEA

1. Add the plug-in and add the following configur...

Tutorial on deploying the open source project Tcloud with Docker on CentOS8

1. Install Docker 1. I installed Centos7 in the v...

N ways to center elements with CSS

Table of contents Preface Centering inline elemen...