reset.css
Be default, browsers like Firefox and Internet Explorer have different ways of rendering styles. reset.css basically reset all fundamental styles, so you start with a foundation with settings that looks exactly the same cross browsers.
Here are some of the commonly used reset.css frameworks - Yahoo Reset CSS, Eric Meyer’s CSS Reset, Tripoli
.header { background-color: #fff; background-image: url(image.gif); background-repeat: no-repeat; background-position: top left; }
.header { background: #fff url(image.gif) no-repeat top left }
Class
ID
These two selectors often confuse beginners. In CSS, class is represented by a dot "." while id is a hash ‘#". In a nutshell id is used on style that is unique and don’t repeat itself, class on the other side, can be re-use.
class
id
More - Class vs. ID | When to use Class, ID | Applying Class and ID together
<li>
<li> a.k.a link list, is very useful when they are use correctly with <ol> or <ul>, particulary to style a navigation menu.
<ol>
<ul>
More - Taming Lists, Amazing LI
<table>
<div>
One of the greatest advantage of CSS is the use of <div> to achieve total flexibility in terms of styling. <div> are unlike <table>, where contents are ‘locked’ within a <td>’s cell. It’s safe to say most <table> layouts are achievable with the use of <div> and proper styling, well maybe except massive tabular contents.
<table>,
<td>
More - Tables are dead, Tables Vs. CSS, CSS vs tables
It’s always good to get instant preview of the layout while tweaking the CSS, it helps understanding and debugging CSS styles better. Here are some free CSS debugging tools you can install on your browser: FireFox Web Developer, DOM Inspector, Internet Explorer Developer Toolbar, and Firebug.
ul li { ... }
ol li { ... }
table tr td { ... }
li { ... }
td { ... }
<tr>
!important
.page { background-color:blue !important; background-color:red;}
background-color:blue
background-color:red;
<h1>title</h1>
h1 {text-indent:-9999px;background:url("title.jpg") no-repeat;width:100px;height:50px;}
text-indent:-9999px;
background: {...}
width
height
The following article gives you a clear understanding in using CSS positioning - position: {...}
position: {...}
More - Learn CSS Positioning in Ten Steps
@import
<link>
There are 2 ways to call an external CSS file - respectively using @import and <link>. If you are uncertain which method to use, here’s few articles to help you decide.
More - Difference Between @import and link
Web forms can be easily design and customize with CSS. These following articles show you how:
More - Table-less form, Form Garden, Styling even more form controls
This following article gives you an idea how to create cross-browser compatible rounded borders with CSS.
If your CSS codes are messy, you are going to end up coding in confusion and having a hard time refereing the previous code. For starters, you can create proper indentation, comment them properly.
More - 12 Principles For Keeping Your Code Clean, Format CSS Codes Online
px
em
Having problem choosing when to use measurement unit px or em? These following articles might give you a better understanding on the typography units.
More - Units of Measurement in CSS, CSS Font size explained, Using Points, Pixels, Ems, or Percentages for CSS Fonts
We all know each browser has different ways of rendering CSS styles. It’s good to have a reference, a chart or a list that shows the entire CSS compatibility for each browser.
CSS support table: #1, #2, #3, #4.
Dedicated editors are always better than a notepad. Here are some we recommend:
More - Simple CSS, Notepad ++, A Style CSS Editor
There are few media types when you declare CSS with <link>. print, projection and screen are few of the commonly used types. Understanding and using them in proper ways allow better user accessibility. The following article explains how to deal with CSS Media types.
More - CSS and Media Types, W3 Media Types, CSS Media Types, CSS2 Media Types
Bu yazıyı ilk değerlendiren siz olun
Tags: css
Web