» Advantages of CSS
by
Alex Benson of MCP Media, Inc.
Let’s say you run a small company selling customized
table lamps. After years of operating successfully from your
storefront in Smallville, USA, you decide to expand your market
by turning to the power of the Internet. You do your research,
and your website is first rate. After a few months, the owner
of the company – a huge Green Bay fan – decides he
wants the website colors to be changed to green and gold by kickoff
time the next day. You call your spouse to say you won’t
be home for dinner, as you sit down to manually edit each of
the dozens of HTML files one by one. While drinking your tenth
cup of coffee, you realize there must be a better way.
Thanks to Cascading Style Sheets, or CSS, there is. CSS is
a method of controlling the style of web pages without altering
the HTML structure of a page. It accomplishes
this by setting attributes for various HTML tags in a CSS file – called
a style sheet – that is separate from the web page file. To apply the
CSS settings, you simply insert a line of HTML code that calls up the style
sheet.
You can even create several different style sheets for different types of web
pages within your site. Perhaps you want your product listing pages to look
one way and your customer support pages to look another. CSS makes this easy.
For instance, you can set the colors for all the text in a
web page, or group of pages, in your CSS file, and if you want
to change the settings, you simple
edit the CSS file, as opposed to having to go through and change the HTML
source. In the situation described above, you could simply edit
the website’s CSS
files and be home well in time for a well-deserved meal.
Virtually any HTML element can be controlled by CSS. For example,
it allows you to indent all the text on your website, thus producing
margins without
using
cumbersome (and unnecessary) tables. It allows you to control the fonts,
colors, and layout of your site in a much more intuitive and convenient
way than by
using HTML alone. And again, it allows changes to be made quickly and easily.
Compatibility with CSS is becoming standard, however there
are some older
browsers, PDA’s, and cell phones that are not compatible. This is
not a huge drawback because the HTML is still displayed in these instances.
The key is not to allow
the ease of CSS to tempt you into sacrificing good, solid HTML structure.
In other words, be sure that your HTML can stand by itself if necessary.
By separating web page style from substance, CSS can save valuable
time when building or changing your website, as well as streamline
your HTML
source
code.
Alex Benson is a creative writing specialist and for MCP Media,
Inc. MCP Media is a Phoenix
Arizona based web design, web development, and internet business
development firm.
Need a professional web
design company to enhance your business? Request a FREE web design quote!
MCP Media- intelligent multimedia solutions. |