WebTrainingRoom Online Courses
Online Training for Asp.net MVC Web Designing Development, MS SQL, Digital Marketing

How to use Div CSS, DIV Example


DIV CSS style Example
CSS style for DIV and Span is often useful; you can directly set standard style for DIV, Span, but that may not be good idea because div and span object are used multiple places with different style, so here we learn how to write class and apply on div and span .

Here are few div
My DIV 1
My DIV 2
My DIV 3
My DIV 4


Here is css class ".myDiv" for Div
.myDiv
{
    border:solid 1px #0094ff;
    padding:10px;
    margin:5px;
    font-size:15px;
    font-family:Verdana;
    text-align:center;
    border-radius:10px;
}
        
.myDiv:hover
{
    background-color:#808080;
    color:#fff;
    font-weight:bold;
}

You can also specify how any text with hyperlink will look like in your div


Here is the CSS code
.myDiv a       
{
    color:red;
    text-decoration:none;
}
.myDiv a:hover
{
    color:yellow;
    text-decoration:none;
}

Floating Div Example

Floating Div is very useful for web page designing, using floating div we can any type of responsive website, very simple to set elasticity to a webpage

<div style="float:left;width:25%;">
</div>
<div style="float:right;width:70%;">
</div>
<div style="clear:both;"></div>

After using float you must use clear style like style="clear:both;"

In this context you should also understand how DIV element can be used HTML and JavaScript


Comment
Name Email Website
Subscribe
 
Div CSS Style, Floating DIV Example, CSS Tutorial



Consulting