id: 5
Category: CSS
Rated:
Div using CSS
Things you will need:
`Basic knowledge on CSS
`Basic understanding of Divs in HTML
`Basic understanding of pixels
Making Divs is just as easy with CSS as it is with HTML. There isn't much of a difference between the HTML and the CSS except that your properties (such as left and top will be in CSS and not in the DIV tag itself). First we should start our CSS code:
<style type="text/css">
Next we need to know what we want to name the Div and what we want it to do. But what do you mean, name it? In the Div tag you will be entering class="DIV Name Here". This is how you 'name' it. But at the moment, we will build the CSS code.Naming it is another term for giving it a class. In CSS defining classes is as simple as putting the name of the class you want and putting a "." before it. An example:
<style type="text/css">
.divname{
<style type="text/css">
.divname{
left: 00px;
right: 00px;
<style type="text/css">
.divname{
left: 00px;
right: 00px;
border: solid 1px #000000;
background-color: #7777FF;
You can change the font of the text only in the div as well. You do this by adding color:YOUR COLOR HERE; in the example below, I will make the text white.
<style type="text/css">
.divname{
left: 00px;
right: 00px;
border: solid 1px #000000;
background-color:#7777FF;
color: #FFFFFF;
<style type="text/css">
.divname{
left: 00px;
right: 00px;
border: solid 1px #000000;
background-color:#7777FF;
color: #FFFFFF;
}
</style>
<div class="divname">
Text text
</div>
If you have any questions you may contact me using the "Contact us" link under the site navigation.


