[英]how do i remove the extra white space in my website
On my website, it keeps adding extra white space on the right side在我的网站上,它不断在右侧添加额外的空白
I can't figure out how to remove it, I tried the margin padding, and it didn't work我不知道如何删除它,我尝试了边距填充,但它没有用
if it's a problem with my code, then here is the code for the images and styles如果我的代码有问题,那么这里是图像和 styles 的代码
div.box { display: block; margin-left: -1250px; margin-top: -225px; } /* applied for all images, eg box2, box3, box4*/
<div class="box"> <img src="https://i.pinimg.com/736x/76/d8/03/76d80307e603191188e9e7faac52bed3.jpg" alt="cute cat"> </div>
Use the overflow css property:使用溢出的 css 属性:
div.ex1 {
overflow: scroll;
}
div.ex2 {
overflow: hidden;
}
div.ex3 {
overflow: auto;
}
div.ex4 {
overflow: clip;
}
div.ex5 {
overflow: visible;
}
you can simply use padding
& margin
property.您可以简单地使用
padding
和margin
属性。
.box { padding: 0; width: fit-content; height: fit-content; }.box img { margin: 0; }
<div class="box"> <img src="https://i.pinimg.com/736x/76/d8/03/76d80307e603191188e9e7faac52bed3.jpg" alt="cute cat"> </div>
add padding
to your code.为您的代码添加
padding
。
div.box {
padding:0;
...
}
div.box img{
padding:0;
margin:0;
}
try writing some css for image, to make a image responsive we use尝试为图像编写一些 css,以使图像响应我们使用
img {width: 100%;} img {宽度:100%;}
this will tell image to take full width of div..这将告诉图像占据 div 的全宽 ..
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.