How block elements can be centered with CSS1?

Answer

Block level elements can be centered by:

The margin-left and margin-right properties can be set to some explicit value:

BODY {

width: 40em;

background: fluorescent;

}

P {

width: 30em;

margin-right: auto;

margin-left: auto

}

 

All css Questions

Ask your interview questions on css

Write Your comment or Questions if you want the answers on css from css Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---