Hello and welcome to Michael Jones's web site
Current Location: Home->Tutorials->CSS
Here you will be able to find out how to achieve a variety of special effects in web design through the use of CSS!
What is CSS used for?
CSS is great for achieving special effects / custom views. It is widely supported across browsers and the key benefit is
it shrinks page sizes by having an external CSS sheet link (less duplicated code). Also it is very easy to implement.
If used correctly you can even improove accessibility through CSS.
Any other benefits of using CSS?
Another stong benefit to CSS is you get higher search engine placements with cleaner html code. The idea is to remove all styleing from the html and only style with the CSS.
My favorite CSS inspiration comes from CSS Zen Garden where there is a large collection of
different style sheets for the same xhtml document.
How to include CSS in your pages
Method one: Internal CSS
This is generaly used when you don't want to reuse the CSS code on multiple pages.
in the head section of your document:
<style type="text/css">
.classname {color:#000; }
</style>
Method two: External CSS
This is generaly used when you want to reuse the CSS code on multiple pages.
in the head section of your document:
<link type="text/css" rel="stylesheet" href="../css/mikecss.css"/>
How to apply the CSS
Method one: By Element
HTML:
<p>paragraph text in html document</p>
CSS:
p {background-color:#fff; color:#000; }
This format will adjust all <p> elements to the CSS code.
Method two: By Element ID
HTML:
<p id="par1">paragraph text in html document</p>
CSS:
#par1 {background-color:#fff; color:#000; }
As an ID is unique to one instance of one element this format will only adjust that specific <p> element.
Method three: By Class Name
HTML:
<p class="classwb">paragraph text in html document</p>
CSS:
.classwb {background-color:#fff; color:#000; }
As a class is not unique to any instance of any element this format will adjust all elements the class is assigned to in the HTML.
Any questions?
If you have any requests or questions
just post them to mike jones by selecting the email link in the main menu of this site at the top of the page.