avazwij avazwij - 9 months ago 36
CSS Question

what's difference between writing element properties in CSS or directly?

Displaying a DIV using CSS:

div.divBg {
background-color : red;
width : 200px;
height : 300px;

This displays what is set in CSS:

<div class = "divBg">

writing the same settings inside the DIV itself does not work:

<div background-color ="red" width = "200px" height = "300px">

please tell me what i am missing



<div background-color ="red" width = "200px" height = "200px">


<div style="background-color:red; width:200px;height:200px">