how to center a picture in css
for the image to be centered use this css: .centerimg {margin-left:auto; margin-right:auto;}. For the parent container (e.g. the div containing the image-use. .parentdiv {text-align: center;}.Note: the above code will center everthing within the parent div that you specify.iocene22. for the image to be centered use this css: .centerimg {margin-left:auto; margin-right:auto;}. For the parent container (e.g. the div containing the image-use. .parentdiv {text-align: center;}. Note: the above code will center everthing within the parent div that you specify.