Can you help me out with the differences b/w div and class in CSS. I mean they are both used for the same purpose? Using classes I can apply a particular effect to 1 of the 8 paras as in tne tutorial wheres in the case of div I can position the things wherever I want? I mean does the div attribute does not support color , font-weight ,etc? so that we could actually eliminate the use of classes altogether?
Difference b//w div and class in CSS
Post a Reply
|Oldest Newest Rating|
· March 8, 2015
A div is just a container, a class describes what kind of container the div is and what properties the stuff inside will have.
As an example, for a standard site built using a grid system:
what you see are two divs, one is a column and on is a row.
in this example the class .text-center aligns all the text inside the column div to the center