CSS - The Basics

Thinking about CSS, but want to learn what youThe syntax of CSS consists of the selector and the
need to know, or need to learn before jumping ontodeclaration. The selector is the identifier within the
the CSS bandwagon? Let me begin by saying thatbody of your web page; the declaration is the code
CSS can reduce your time at the computer. Butthat identifies the style that you want to put into
knowledge do you need to learn and is CSSplace as to property and rule. Lets say you want all
compatible with the search engines and youryour H1 headlines to be green, with the font Arial. the
browsers? These are some of the questions I'll trycode for CSS would be as follows:
to answer,as well as, explain a little about what CSSNote: Do not include quotes around the code.
is all about."selector {property: rule;}"
What is CSS?"H1 {color: green; font-family: Arial;}"
CSS stands for Cascading Style Sheets. CSS is a setNote: Notice that the property and rule must be
of formatting instructions that controls the looks of aenclosed in {}.
web page or pages. Some of the browsers thatPlacement of CSS
support CSS is: (Firefox,IE3 or later, NN4 or later).There are three places to put your CSS code:
You may be saying, great this will definitely save meIn the Head (Internal), in an external file, or within an
some time. Not so fast, you also need to know thatindividual tag (Inline style).
though, the majority of the browsers understandInternal -is used within a single web page that may
CSS, they do not fully support all of it's capabilities.have a unique style.
XHTML - XHTML is EXtensible HyperText MarkupInline - mixes code with content. Sometimes you
Language. XHTML Is HTML with stricter rules-thatmay need to use it, but this style does seem to
adds conformity and, is 100% XML compliant. So youeliminate the need of even using a CSS style sheet.
should be familiar with or become more comfortableExternal - The CSS is separate from the body of the
with HTML, XHTML, and the style properties of CSS.web page and is linked with the web page. Thus, to
What can you do with CSSlink an external file into a web page you will need to
You can build your layout,adjusting size and color ofuse the link tag.
your headings or body text, as well as positioningExample: (Goes in the head section after the title
your pictures. This translates into like pages beingtag)
programmed once, without the choice of inputtingWhich way do you go? If you have a large site or a
the same coding into each of your web pagessite that will be expanding, an external file would be a
manually. Translated, elimination of duplicatebetter way to quickly and easily manipulate all your
formatting.web pages at once.
How to get the Search Engines to See Your CopyWatch out for Spam
It has been said that the Search Engines still haveBut with anything on the Internet, CSS can be used
some problems with understanding CSS. But if youfor the good and the bad. And obviously, if you want
want to use CSS, is there a way to get the searchto keep your site up and running for a long time,
engines to see what you want.some CSS techniques should be avoided. Why?
1. Keep your text clean, if you have to muchBecause some CSS techniques can be considered
garbage in your web page, than the spiders will havespam by the search engines and thus, ban your site
a difficult time in determining what is relevant andif you use the techniques. The blackhat tactics include
what is not. Thus, CSS keeps your web page clean,such things as: 1) using CSS to hide text-from
without the redundant coding needed for eachheadlines to body from the human eye; 2) hiding and
individual element of code. Here is an example ofbolding or italicizing copy for search engine spiders
how to code a headline; with the CSS code below.benefit only.
Example: "h1"Title"/h1" (replace beginning and endTo conclude, CSS can and is a viable way to making
quotes with )your web pages easier to maintain-if the majority of
"CSS code: H1 {font family: Arial size: 18 px; bold;}"your pages follow the same format. If you are not all
(leave off quotes)that familiar with CSS, then take the time to look at
Syntax of CSStutorial. It's very informative and can get you started
First, CSS can be written within any text editor. Butwith CSS..
the text file must be saved with a CSS extension.