我有一个网站,其中的 div 有一些文本和背景颜色。
<div class="info-box synopsis">
Some text
</div>
.synopsis {
background:#0d101c;
text-indent:40px;
opacity:0.6;
margin-top:20px;
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
font-family: 'Roboto Condensed', sans-serif;
line-height:25px;
font-size:1.30;
text-align:justify;
border:1px solid #0d101c;
}
.info-box {
padding:10px;
color:#d2d2d2;
font-size:1em;
}
当屏幕全宽时它工作正常。但是,如果我们将屏幕尺寸缩小,div 中的文本就会超过 !请引用我附上的图片。请在这方面帮助我。
网址:Rajsree
最佳答案
删除div元素并将类分配给body标签,
<div class="fullscreen-img"></div>
像这样将类分配给正文标签,
<body class="fullscreen-img">
然后通过修改背景属性来更新类的css。
.fullscreen-img {
background: url("2.jpg") no-repeat scroll;
从背景中删除 center 属性。
如果您难以将图像放置在正确的位置,请将图像大小编辑为适当的像素。
关于html - 窗口大小减小时框内的文本超出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21777015/