CSS 58; The Basics - ID s and Classes ... Licence
Css
Cascading Style Sheets
Two types of style sheets: Internal and Outer
Internal - You involve your style enactment equitable into your html code.
These stylesheets should one be used provided you are intending to
create a particular folio with a specific style. Whether you demand to be
able to create global changes to your website using by oneself one style
sheet, you enjoy to use....
External Stylesheets - Instead of putting all the style edict into
your html code, you can devise a unmarried file with your css
code and link to it within your webpages code. It would gaze
something enjoy this
{head}
{title}Webpage title{ itle}
{link rel="stylesheet" type="text/css"
href="http://www.yourdomain.com/css"}
{/head}
If you decide to avail an internal stylesheet, you bear to assign your
css style wihin the consequent tags:
{style type="text/css"}
{/style}
All css or links to the outward stylesheets hog to pep in
between the {head} tags
Now approximately Css Classes vs. ID's
The one chief aberration between a crowd and an id is that
classes can be used multiple times within the identical chapter while an
Id can peerless be used once per page.
Example:
ID - The global pilotage of your site, or a manoeuvring bar. A
footer, header, etc. Matchless items that arise in individual one assign
per page.
Class - Anything that you would bag multiple times in your page,
such as titles, subtitles, headlines, and the like.
Creating ID 's
To contrive an Id in your css, you would exit with the quantity notice
(#) and then your classify of the id. Here's an archetype
#navigation {
float:left;
}
To encompass the id in your html, you would end something allied this
{div id="navigation"}
{/div}
You can too include an id within another one adoration this
{div id="navigation"}
{div id="left}
{/div}
{/div}
Remember to hurried the id's in order.
Now, onto css classes.
Creating Classes
To generate a aggregation in your css, employ this
.subtitle {
color: #000000;
}
To incorporate the assemblage into your html, engage in this
{p class="subtitle"}
{/p}
Now, you can utilize the equivalent group repeatedly in the twin event
unlike Id's.
I as well require to advise you something about link attributes. You
should always direct them in this order:
a {
color: #006699;
text-decoration: none;
font-size: 100%;
}
a:link {
color: #006699;
text-decoration: none;
}
a:visited {
color: #006699;
text-decoration: none;
}
a:hover {
color: #0000FF;
text-decoration: underline;
}
a:active {
color: #FF0000
}
Of course, you can pocket money the colours and text-decorations. This
is equitable something I chop gone of my code!
Okay, these are the basics. What I highly reccomend is to potency and
download Topstyle Lite by going here:
http://www.bradsoft.com opstyle slite/index.asp
It's unpaid and is a besides considerate css editor. It not lone colour
codes and organizes your code, nevertheless it provides you with tons of
attributes that you can add to your troop and id elements with
just a click. They besides equip a shade at the backside to landscape your
css principle as you effect it. Indubitable beneficial for a cuffo edition and
I'm looking to get the pro legend soon.
Now, this was aloof a further appropriate minor explanation of the important
elements needed when structuring your css. I carry a fine enjoyment
that when you download top style lite, you testament become versed how to applicability
the hundreds of attributes in your classes and id's
Good Luck in Your Netting Designing Efforts!
P.S Replace { and } to < and >
Published: January 15, 2008