how to get text centered on top of image html code example

Example 1: make image go to center of page

//Making an image go to the center of the page
//A
<img src="wuteva.jpg" class="center">
//B
<parentElement style="text-align: center;">
//C
// put the image in a div with style="text-align: center;"

Example 2: how to make text center above image html

#container {
  text-align: center;
}

.text {
  display: inline-block;
  margin: 0 20px 0 20px;
}

.img {
  margin: 0 20px 0 20px;
  width: 50px;
  height: 50px;
}

Tags:

Html Example