In the old days, we depend a lot of on developers and programmers to help update the website, even when it’s just a minor one. Thanks to the CSS and it’s flexibility, styles can be extract independently away from the codes. Now, with some basic understanding of CSS, even a novice can easily change the style of a website.
Whether you are interested in picking up CSS to create your own website, or merely to tweak your blog’s look and feel a little – it’s always good to start with the fundamentals to gain a stronger foundation. Let’s take a look at some CSS Tips we thought might be useful for beginners. Full list after jump.
1. Use reset.css
When it comes to rendering CSS styles, browsers like Firefox and Internet Explorer
all fundamental styles, so you starts with real blank new stylesheets.
Here are few commonly used reset.css frameworks – Yahoo Reset CSS, Eric Meyer’s CSS Reset, Tripoli
2. Use Shorthand CSS
Shorthand CSS gives you a shorter way of writing your CSS codes, and most important of all – it makes the code clearner and easier to understand.
Instead of creating CSS like this
.header {
background-color
:
#fff
;
background-image
:
url
(image.gif);
background-repeat
:
no-repeat
;
background-position
:
top
left
;
}
It can be short-handed into the following:
.header {
background
:
#fff
url
(image.gif)
no-repeat
top
left
}
3. Understanding Class
and 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.
4.Power of <li>
<li>
a.k.a link list, is very useful when they are use correctly with <ol>
or <ul>
, particularly to style a navigation menu.
5.Forget <table>
, try <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.
6.CSS Debugging Tools
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.