2017-08-08 35 views
0

無論屏幕大小如何,我都希望我的文本保持所有格式,但如果要使屏幕足夠小,它將更改其格式以適合屏幕。如何讓文字無法響應?

我該如何使它保持原來的位置和格式。

<div style="background-color: white; height: 600px; padding: 100px 200px;"> 
 

 
    <br><br><br> 
 

 
    <h1 style="font-size: 70px;color:#21ce99;">about me</h1> 
 

 
    <p style="font-size: 20px;color: #0ec998">I'm a Developer and aspiring Entrepreneur <br>from Voorhees, New Jersey in the US.</p> 
 
    <p style="font-size: 16px;color: #0ec998">As a young developer, I strive to make complex <br>problems, simple. Combined with my passion <br>for entrepreneurship, I hope to create something<br>that can beneficially impact the world.</p> 
 
</div>

回答

0

你可以嘗試使用最小寬度和最小高度屬性在你的風格標籤給他們的最小寬度和高度。確保不要使用諸如vh,em之類的相對度量單位,或者使用像素來完全忽略屏幕大小。您應該將這些屬性放在圍繞文本的div上。

0

簡單地指定您不想包裝CSS'空白屬性的文本。

0

空白屬性指定一個元素內的空白如何被處理。

空格的序列將收縮爲單個空格。文本將永遠不會換行到下一行。文本繼續在同一行,直到遇到<>標記。

現在更多的,你可以參考文本屬性:W3school White-space

p{ 
 
    white-space: nowrap; 
 
}
<p>Your desired textYour desired textYour desired textYour desired textYour desired textYour desired textYour desired textYour desired text</p>