+ 1
How to move Image in CSS?
I want to make my website an move all image to the center
2 ответов
+ 1
Hello!
For getting the image to a certain dimension use in the img tag this :
<Img scr="image.jpeg" width="120" height="120">
you should define it IN PIXELS.
Then refeer to it in css and use those rules :
Position : absolute;
Top : //position + px
Left : //position + px
Right : //position + px
Left : //position+px
Ignore those //, theyre comments so the text would be :
.myDiv {
position : absolute;
top : 220px;
}
Dont use top + bottom or left + right, It wont work.
I hope to have been helpful! Bye :)
Please upvote my question!
+ 1
Try <div><img src=“img.jpg”/> </div>
Then in css try:
div {
text-align: center;
}
Alternatively you could use css flexbox