I have a square div frame, which does not have a fixed px and is written with Baxian%. Then I want to put a rectangular picture in it and then center it up and down. Can you do it?
What to do? Urgent ~ ~
Also, this rectangular image needs to be compressed to the height of the square
margin:auto;
The image must have a width
If the height is known, like this:
<style type="text/css"> div { text-align:center; outline:1px solid #ccc; height:200px; line-height:200px; } </style>
<div> <img src="0.png" /></div>
Method 1: You can use body{text- align:center} In this case, everything is customized.
Method 2: Use align="center" in img
Puke International Stay.