..


Sponsored Links

How do I center an image horizontally with CSS?

There are several ways. The most immediate is to use a container for the image to apply the text-align property with a value center:






 <div style="text-align:center">



  



 <img border="0" src="miafoto.jpg"/>







 </ Div>



A more "refined" is to apply the margin directly to the image in this way:





 <img border="0" src="miafoto.jpg" style="margin: 0 auto;"/>



In the same category ...
E-Learning
CSS (Course) CSS (Course)
Web Design and Accessibility according to W3C CSS and XHTML. Starting from 29 €.
HTML (Course) HTML (Course)
The markup language for the Web from 29 €.
Webmaster Advanced (Course) Webmaster Advanced (Course)
Become a professional Webmaster. From 39 €.
Sponsored Links