gpt4 book ai didi

html -
元素 : How can i get my div text to be as it is while resizing

转载 作者:太空宇宙 更新时间:2023-11-03 18:13:16 24 4
gpt4 key购买 nike

我创建了这个 JSfiddle对于我的问题。

在这个特殊的 fiddle 中,当我们调整窗口大小时,div 元素会相应地改变自己。但我希望那不会发生。使用 {white-space: nowrap;} 似乎不是一个好的选择。小帮助将不胜感激。谢谢。

<body>
<p>This is a paragraph with no specified margins. i am writing stuffs to just make things long so as to provide a better understanding of my question.</p>
<p class="margin">This is a paragraph with specified margins. i am writing stuffs to just make things long so as to provide a better understanding of my question. Press the "restore down" button present before "close button" or resize the window. It will change it shape according to CSS. I want that not happen. it should appear as it is while restoring or resizing.</p>
<p align="center"> In short i want a responsive "div" elements. </p>
</body>

我需要固定 div 元素,它们在调整大小时不应该改变自己。谢谢。

最佳答案

设置body width fix来解决这个问题,

body{
margin-left: auto;
margin-right: auto;
width:400px;
}

检查这个 demo jsFiddle

关于html - <div> 元素 : How can i get my div text to be as it is while resizing,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23284248/

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