Monday, October 22, 2012

CSS Stylesheets or Syncing Webpages Easily

Css was made to save time. If you have a site where you want all the background colors, links, text, link hover colors and stuff like that to be the same on all pages, CSS stylesheets are the quickest way to do that. In fact, CSS stands for Cascading Style Sheets. 
1. Open notepad or any plain-text editor. Enter this code: Highlighted text is for you to change.
h3
{
 color:black;
text-align:left;
font-size:8pt;
}


Now for the Background. Remember, multiple styles cascade into one style.

body {background-color:#FFFFFF;}

You could also use an image background. This is for positioning an image in the top right corner.:
body
{
 background-image:url('image_URL');
background-repeat:no-repeat;
back
ground-position:right top;
}


If you want the image to repeat the whole length of the page:
body
{
 background-image:url('image_URL.png');
background-repeat:repeat-x;
}


Save as "Stylesheet.css"
2.Adding the style sheet to webpages. Insert this code between the <head> AND </HEAD> tags. This is where the <TITLE> tag is. 

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

No comments:

Post a Comment

Feel free to comment. Keep it nice, polite and on topic. You may link to a site if it contains content relates to the content of whatever post you are commenting on. You may link to a site that only uses, for example, HTML5 video. Remember, on topic!