CSS Basics

by KW_Admin 27. May 2009 23:39

For any developer the introduction of CSS coding has enabled them to grasp the concepts of design without too many headaches. CSS styling represents the way the HTML should have been back in the 80s. A structured set of rules for where and how to layout the pages.

There are simple and complex uses of CSS that can be employed for websites.

The best way is to provide a link to the text-based css file rather than embedding the styles within the page.

See the example below

<head>
<link rel="stylesheet" type="text/css" href="mystyle.css" />
</head>
 

 The other method is the embedding of the styles within the page.

<head>
<style type="text/css">
<!--
hr {color:sienna}
p {margin-left:20px}
body {background-image:url("images/back40.gif")}
-->
</style>
</head> 

The problem with this is that you have to maintain each page for any changes the design, fonts or colours for the site.

There is a third method that is often as a short-cut or quickfix method with designers that want to tweak design elements quickly for clients. The method in question is inline css. Here is an example.

<p style="color:sienna;margin-left:20px">This is a paragraph.</p> 

Part 2 will be the basics of the box model.

 

 

Tags:

CSS

Comments

Add comment


(Will show your Gravatar icon)  

  Country flag

biuquote
  • Comment
  • Preview
Loading



Theme Modified by Kelticweb

Kelticweb Solutions

Dublin Web Design and website applications company since 2005. Specialising in microsoft based technologies and applications.

Visit www.kelticweb.com