CSS BASICS
Key elements in CSS as you start is that it should be in a CSS (Cascading Style Sheet) format. However you feel comfortable, you may use different programs to write it.
Key principles in CSS is that you must always have { after the title (ie. h2, img, a:hover; customized ones--#table, #content, .header) and you must always have the } after your last line of CSS.
For example, a customized CSS could look like this:
#navigation{
width: 100px;
border: 0px;
font: 12px century gothic;
color: #000000;
background-color: #ffffff;
margin-right: 10px;
padding-right: 10px;
}
When putting this in HTML, all you need to plug into the coding for all of the styles that you have to put the code: <div id="navigation"> and ending all the CSS that you have coded, you put </div>.
If you change the coding in the CSS to ".navigation" then the coding for HTML would be <div class="navigation">.
-width represents the width of how wide your navigation will be.
-border is the thickness of the border of the whole navigation.
-font is the style of text that you choose to put on the navigation area with its respectful pixels.
-color is the color of the font, but in some cases if it doens't work, type in text-color to be more specific.
-background-color is the background color of the whole navigation. All colors must be in hex codes or in just color names, but normally in HTML and CSS, we use hex codes.
-margin-right is the margin from the right the whole navigation will be from the right of the website page. So the navigation will be very close to the right of the website page.
-padding-right is the margin from the right of the navigation where the text will be.
So why use CSS? :) So think about it, if you want to do the <style> tag thing for every page, it takes up too much space since it will be repeating the same coding. Why not replace all that CSS with just one simple code? The most important element into binding the CSS with the HTML is the code:
<link rel="stylesheet" href="style.css" type="text/css">.
You can replace style.css to "name.css" or whatever name before the .css format.
Home | Site Information | Policy and FAQ | Linkage
Site and layout is © to Heidi Hu. All tutorials, information and items are copyrighted to their rightful owners. All rights reserved.