How block elements can be centered with CSS1?

Answer Posted / hrpynux@gmail.com

With css the way to center anything that's a block level element is with the margin property. One of the values of margin is auto and by setting auto on the left and right margin our block level element will center itself.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is profit margin percentage?

353


Can you nest flexbox?

370


What is the purpose of px measurement unit?

340


What is a cascading relationship?

342


What is the difference between internal and external style sheets?

332






What is a css reset. What is the difference between a css reset and normalize.css?

350


What is graceful degradation?

348


What is Responsive Web design?

412


How does a style sheet work?

337


What is the difference between a relative, fixed, absolute and statically positioned element?

378


What are css modules in react?

376


Does css work in notepad?

342


What does :: before mean in css?

377


What are the different media types allowed by css?

424


Can you add multiple classes to an element?

356