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

How to write CSS style for Html BODY


How to apply CSS to HTML body element?

Body css style should remain same throughout the web site, so you need not to create any separate class , just mention right padding, margin, width etc in Body itself

This is how you can write in your css file
body            
{
    margin:auto;
    width:1024px;
    padding:10px;
    background-color:#ebebeb;
    font-size:14px;
    font-family:Verdana;
}

Body css style will be automatically applied in all html pages

you also can write a class and then apply to html body element, in case you want different look for different page in the same web application

<style>
.bodyDesign {
margin: auto;
border: solid 2px #0094ff;
font-size: 15px;
font-family: Verdana;
background-color: #dffe91;
}
</style>
// now you can apply the class to body element
<body class="bodyDesign">

Above approach may be very useful when you have multiple section in your webpage, and you want to give different look to different section, for example section for client and section for vendors


Comment
Name Email Website
Subscribe
 
CSS style for Html BODY, CSS3 Tutorial



Consulting