Code Monkey home page Code Monkey logo

cssreset's Introduction

cssreset

css style reset by linfs

2017-08-31 created

有margin值的元素有:

body h1 h2 h3 h4 h5 h6 p blockquote pre hr figure dl dd ul ol fieldset menu

有padding值的元素有:

ul ol button th td fieldset legend textarea menu

有border值的元素有:

hr input button fieldset textarea

虽然这些都有border,不过个人觉得没有必要进行重置。

body,h1,h2,h3,h4,h5,h6,p,blockquote,pre,hr,figure, dl,dd,ul,ol,fieldset,menu{margin:0}
ul,ol,button,th,td,fieldset,legend,textarea,menu{padding:0}
HTML5新标签针对旧浏览器重置
header,footer,section,article,aside,nav,hgroup,address,figure,figcaption,menu,details{display:block;}
其它元素样式重置
body
body{
  line-height:1;
}
字体大小
h1,h2,h3,h4,h5,h6,pre{
  font-size:100%;
}
列表
ol,ul{
  list-style:none;
}
表格
table {
  border-collapse: collapse;
  border-spacing: 0;
}
链接
:link,:visited{
  text-decoration:none;
}
金手指
a,button,input[type='button']{
  cursor:pointer;
}
利用伪类清除浮动
.clearfix:after {
  content:".";
  display:block;
  height:0;
  visibility:hidden;
  clear:both;
}
.clearfix {
  *zoom:1;
}

查看 cssreset文件说明

更多css规范 NEC

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.