Beruflich Dokumente
Kultur Dokumente
Whether you are interested in picking up CSS to create your own website,
or merely to tweak your blogs look and feel a little its always good to
start with the fundamentals to gain a stronger foundation. Lets 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 have different ways of handling them. reset.css
resets all fundamental styles, so you starts with a real blank new
stylesheets.
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.
1.header {<br>
2 background-color: #fff;<br>
3 background-image: url(image.gif);<br>
4 background-repeat: no-repeat;<br>
5 background-position: top left; <br>
}
6
1.header {<br>
background: #fff url(image.gif) no-repeat top
2left<br>
3 }
<li> a.k.a link list, is very useful when they are use correctly with
<ol> or <ul>, particulary to style a navigation menu.
Its 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.
o
o
1ul li { ... }
1ol li { ... }
1table tr td { ... }
1li { ... }
1td { ... }
Explanation: <li> will only exist within <ul> or <ol> and <td>
will only be inside <tr> and <table> so theres really not necessary
to re-insert them.
8. Knowing !important
1h1 {<br>
2text-indent:-9999px;<br>
3background:url("title.jpg") no-repeat;<br>
4width:100px;<br>
5height:50px;<br>
}
6
If you are looking around for nicely designed CSS-based website for
inspiration, or just simply browsing to find some good UI, here are
some CSS showcase site we recommend:
o CSS Remix
o CSS Reboot
o CSS Beauty
o CSS Elite
o CSS Mania
o CSS Leak
o
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.
Having problem getting the left, middle and right column to align
properly? Here are some articles that might help:
o Faux Columns
o Absolute Columns
o
Dedicated editors are always better than a notepad. Here are some
we recommend:
o
o
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.