Code Monkey home page Code Monkey logo

css-reference's Introduction

  1. CSS box models
  2. Floats
  3. Normalize.css vs resets
  4. Em and rem units
  5. When to use the button element
  6. Using non-standard fonts
  7. Image replacement techniques
  8. Writing efficient CSS

There are 2 different box models:

  1. In the W3C box model, the width of an element gives the width of the content of the box, excluding padding and border.

  2. In the traditional box model, the width of an element gives the width between the borders of the box, including padding and border.

By default, all browsers use the W3C box model, with the exception of IE in "Quirks Mode" (IE5.5 Mode), which uses the traditional one.

The box-sizing property allows you to switch box models:

box-sizing: border-box
box-sizing: content-box

The first declaration will cause the box sizes to be applied to the border and everything inside it (traditional model), the second one will cause the box sizes to be applied to the content only (W3C model).

Use the universal selector to apply a natural box layout model to all elements, but allowing components to change

html {
  box-sizing: border-box;
}
*, *:before, *:after {
  box-sizing: inherit;
}

Compatibility : IE8+ http://caniuse.com/#search=box-sizing

Source:

http://quirksmode.org/css/user-interface/boxsizing.html

http://www.paulirish.com/2012/box-sizing-border-box-ftw/

Source: http://css-tricks.com/all-about-floats/

Source: http://stackoverflow.com/questions/6887336/what-is-the-difference-between-normalize-css-and-reset-css

Source: https://j.eremy.net/confused-about-rem-and-em/

Source: http://css-tricks.com/use-button-element/

Webfonts (font services like: Google Webfonts, Typekit etc.)

Source: http://css-tricks.com/css-image-replacement/

Source: http://csswizardry.com/2012/05/keep-your-css-selectors-short/

css-reference's People

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.