gpt4 book ai didi

html - 缩小时使文本周围的区域变大

转载 作者:行者123 更新时间:2023-11-28 19:10:26 25 4
gpt4 key购买 nike

我希望我的文本周围的黑色区域在缩小时变大,而不是在那里成为我文本右侧的白色区域,这就是当前正在发生的情况。我试图设置宽度:自动;在两个 div 上,但黑色部分完全消失了。这是我的 html 代码:

<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="css/stylesheet.css">
<title>lorem</title>
</head>
<body>
<p style="white-space: nowrap">
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum nec ipsum aliquam enim faucibus ultricies ut imperdiet ex. Phasellus ut quam sed velit ultrices tempor non eget urna. In vehicula sodales ante ut malesuada. In odio elit, congue a gravida id, semper non tellus.
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
</p>
<div class="div1">
</div>
<div class="div2">
</div>
</body>
</html>

这是 css 部分:

@font-face {
font-family: "Consolas";
src: url("Consolas.ttf");
}

*{
box-sizing: border-box;
margin: 0;
padding: 0;
}
main {
position: relative;
}
p{
display: inline-block;
font-size:15px;
font-family: "Consolas";
margin: 0 3px;
width: 900px;
position:relative;

}
.div1{
background-color: black;
float: right;
height: 40000px;
width: 50px;
}
.div2{
background-color: black;
float: left;
height: 40000px;
width: 50px;
}

我希望这三张图能帮助澄清问题。当我缩小我上传到我的网站的文本时,而不是文本右侧的黑色部分填充增加的空间,它被空白填充。也就是说,我希望我在图片中用红色绘制的部分是黑色而不是白色...

the one where I haven't zoomed out the one where I haven't zoomed out the one where I have zoomed out to 90% the one where I have zoomed out to 90% the one where I have zoomed out to 70% the one where I have zoomed out to 70%

我是个新手,有 friend 帮我写代码,所以我意识到我可能完全走错了路,但在此先感谢:)

最佳答案

你是说浏览器缩放吗?

    .zoom
{
zoom: 150%;
background-color: black;
*/ your remaining styles*/

}

关于html - 缩小时使文本周围的区域变大,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59432526/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com