Answers for "how to centre an image in html"

CSS
44

css center image

.center {
  display: block;
  margin-left: auto;
  margin-right: auto;
}
Posted by: Guest on November-28-2019
13

html center image

/* Here is the CSS code! */
img {
  display: block;
  margin-left: auto;
  margin-right: auto;
}
Posted by: Guest on October-17-2020
12

center image css

.centerImg {
  display: block;
  margin: 0 auto;
}
Posted by: Guest on June-01-2020
0

image align center

.center {
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: 50%;
}
Posted by: Guest on July-22-2020
1

center image html

.centered {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  -webkit-transform: translate(-50%, -50%);
  -moz-transform: translate(-50%, -50%);
  -o-transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  
  font-size: 20px;
  background-color: cyan;
  border: darkgreen 5px solid;
  padding: 5px;
  z-index: 100;
}
Posted by: Guest on January-04-2021
0

How do i allign a pic centre in html

<img src="Sanjith.jpg" class="centre" height = "200" width = "100">
Posted by: Guest on September-13-2020

Browse Popular Code Answers by Language