Css Div

What Does CSS Div ?

Divisions are a block level (X)HTML element used to define sections of an (X)HTML file.
A division can contain all the parts that make up your website. Including additional divisions, spans, images, text and so on.

You define a division within an (X)HTML file by placing the following between the tags:

<div>
Site contents go here
</div>

Though most likely you will want to add some style to it. You can do that in the following fashion:

<div id="mainBox">Site contents go here</div>

The CSS file contains this:

#mainBox{
width: 70%;
margin: auto;
padding: 20px;
border: 1px solid #666;
background: #ffffff;
}

Now everything within that division will be styled by the “mainBox” style rule, I defined within my CSS file. A division creates a linebreak by default. You can use both classes and IDs with a division tag to style sections of your website.

  • Welcome to CSS Syntax [dot] com
    Welcome to our Website ... CSS Syntax com is a website that explains about anything related to web...
    www.csssyntax.com
  • CSS 3 Background Color Opacity
    Everyone knows what RGB stands for (red, green, blue), but what does the A stand for?
    www.csssyntax.com
  • CSS 3 Text Shadow
    Using CSS3, we can create shadow effects on text with very simple syntax
    www.csssyntax.com
  • CSS 3 Box Shadow
    Excess CSS3 is able to make something that can not be done by CSS2
    www.csssyntax.com