![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi! I need to put an image inside a box, centering and resizing it to fit the box. The box is positioned and sized in the page using percent values. The problem is that I don't know how can I do it exactly. This is the style code for the box: .box { top: 20%; left: 20%; width: 50%; height: 50%; } This is the style code for the image: .image { text-align: center; ????? } I don't know how to center the image vertically and how to resize it to fit the box mantaining its aspect ratio. Can someone help me, please ? |
![]() |
| Thread Tools | |
| Display Modes | |
| |