You are here: Home / Computer / Web Site / CSS Tricks

CSS tricks

In this section we propose several CSS tricks. Under certain conditions, and depending on the browser used, you will find that the CSS rule is not interpreted properly by the browser, or will not function properly.

The different workarounds that we propose are all compliant with the new W3C standard.

Reminder

The CSS (Cascading style sheets) allow you to give your web page form. Indeed, first you insert the content of your page. Then you give it form: background colour, text colour, margins and frames... In other words, the look of your page.

For that you use CSS.

Principles

The CSS is a specific programming language. A Rule Editing tool is integrated in the Dreamweaver program. Another choice is to use a text editor of your choice.

You can place the CSS program in several locations.

Directly in your web page

The CSS is boxed inside this line <style type="text/css">...</style> and is placed in the header of your page.

Example:

<style type="text/css">
body {      
	scrollbar-arrow-color: #d3dfe4;   
   scrollbar-base-color: #FFFFFF; 
   text-align: left; 
   background-image: url('images/am-novice/monimage.gif');  
}

</style>

 

On a separate folder

You can for instance create a CSS folder that we will name: style.css.

This folder will have all your CSS rules.

Just as before, you have to include this in the header.

Example:

<link href="CCS/style.css" rel="stylesheet" type="text/css" media="screen"/>

You may have noticed the word media at the end of the example line. This allows you to determine where to implement your CSS.
screen for the web page
print for the printer page.....

In the tags

The CSS can also be included in the tag.

Example:

<body text="#000000">  

or more complex

<table border="0" cellspacing="0" cellpadding="0" width="97%" bgcolor="#86a9b6" align="center">