0
How can I fit my image into a box?
5 odpowiedzi
+ 1
It depends on the width and hight of the image and also of the box. it depends also if you want it to be responsive or not...try using width:x% and hight:y%...(with x and y numbers from 0 to 100) you can use also pixels (px)...
Try also to use min-width and hight or max-width...
If you want it in center, don't forget to write text-align: center;
+ 1
background:url(your image.jpg);
background-size:div- width div- height;
ex:
div{
height:100px;
width:100px;
background:url(image.jpg);
background-size:100px 100px;
}
0
you can also try:
.yourTagReference {
background-image: url ('yourBackgroundLocation');
background-size: contain;
}
0
max-width: 100%;
width: 100%;
0
thanks u all