我创建了这个 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/