top image
What is CSS?
id: 1
Category: CSS
Rated:Rating 0 Rating 1 Rating 2 Rating 3 Rating 4
Rate:



CSS stands for Cascading Style Sheets. It was created to edit the properties of HTML/XHTML tags found on your page. It makes it much easier to work with changing colors etc. of any tag on the page. You no longer will have to write a long HTML/XHTML code with all the properties inside the tag itself.

It is more reliable then pure HTML/XHTML. IDs (identifiers) and classes are also something used to make HTML/XHTML easier to work with. (IDs and Classes are not well discussed in this tutorial. It will have it's own tutorial.)

CSS is meant to work with HTML/XHTML, so if you don't know HTML/XHTML you can't really use CSS. There are a few things which are similar with the two, though really it’s not too much:

* Edit properties.
* Has a start and ending tag.


Yea, not too many similarities, but now lets see the differences:

* CSS effects the entire page. HTML effects a small area only inside the tags you have placed a property in.
* CSS starts with <Style type="text/css"> and ends with </Style>
* CSS is used to modify the properties of HTML/XHTML tags.
* When you want to change a property, lets say you want to make all bold text white you'd have to add:
b{
color:white;
}

Let's take a look now at a basic code.

<style type="text/css">
b{
color:white;
}
</style>

Let's break this code apart so we can understand how it is set up. First, the style tag must go in the <head> tag of the document. If it's not in the head tag it will make your page invalid code.

But what does this look like?

<html>
<head>
<style type="text/css">
/*your css code here*/
</style>
</head>
<body>
content here
</body>
</html>

<style type="text/css"> This is the start of the style tag. You need to have type="text/css" for it to be valid. This tells the browser what type you will be using. In this case, the browser will find text(such as comments) and CSS. Without type="text/css" you won't have valid coding and it will tell you "No Style Sheet Found" when you try to validate your CSS coding. Also make sure that you have your CSS in the head tag of your HTML/XHTML. If it is not in the head tag it will not recognize CSS on the page. Again you will be given the error: "No style sheet found".

b{ The <b> (bold tag) is being changed here. In CSS you put the tag in this place without the brakets. { Tells the browser basiclly "properties for bold tags are starting now.".

color:white; Color will be the color of the text inside the bold tag. After { You start to list your properties.This can include color, font-size, font-family, padding, margin, etc

} Like { tells the browser "Properties start here", this tells the browser: "Properties of bold tag end here

</style> ends the style tag.

CSS is pretty easy to learn. You can learn the basics within a day or two but mastering it may take a little longer. CSS will make your site more appealing, and you'll find HTML/XHTML so much easier because you won't have to write out all the tags for changing colors or font styles.




Disclaimer

All contents are © Dice.
If credit for anything is missing please contact me and it will be added. If there is something you wish me to take off the site (that belongs to you) contact me. It will be removed immediatly.

Basic Rules

All tutorials on this site were written by me, Dice. They may not be redistributed without permission! Feel free to link to the videos.

I have used this site also for a project in college :3



home page

Contact Us

About Us