Source Code: (back to article)
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
<style>
div {
border: 1px solid green;
}
div img {
display: block;
margin: 0 auto;
}
</style>
</head>
<body>
<h1>Example of centering an image</h1>
<div>
<img src="/uploads/media/default/0001/01/25acddb3da54207bc6beb5838f65f022feaa81d7.jpeg" alt="Aleq" width="200" height="185" />
</div>
</body>
</html>