Loading...

破版,很醜!!

Temperature: 0 °C

Mark ChangMark Chang
author_tools


破版,很醜!!
破版......很醜對不對!!

我想這是所有從事網頁設計師的痛~

這時你需要的是可以輕輕鬆鬆協助你過關的CSS

文字強迫換行

word-break: break-all;

使用方式
.divname
{
background-color: #e0ebee;
width: 100%;
max-width:600px;
word-break: break-all;
overflow: auto;
margin: 18px 0 18px 0 !important;
padding-top: 0px; 
}

注意~max width 600px,這表示最寬你給我到600px就好就給我強迫換行~

當然,若排版需要,你還可以有其他選擇~

依單字換行
word-wrap:break-word;

使用契機?

若使用文字強迫換行,太長的英文字,會自動切成兩半。

這時就得使用依單字換行方式~

另外.......

還有一個,死都不要給我換行的選擇。
white-space:nowrap;

請審慎使用之~

https://innstory.com/story-破版很醜-1690
CSS

Prev
 javascript獲取當前時間

Next
分享_有神快拜!日手作達人做出會寫時間的機器人手錶超精緻根本可以直接拿去賣!風傳媒 

About the Author

Mark Chang

離不開電腦的宅男

Visitor message

Leave some footprints to prove that you visited me

Recommended reading

Author's other related stories

ubuntu 18.04  apache 目錄啟用並開啟.htaccess 覆寫

ubuntu 18.04 ...

.htaccess是在Apache HTTP Server這款服務器架設軟件下的一個對於系統目錄進行...

使用PHP mb_substr() 函式,擷取部分字串並記得使用UTF-8。

使用PHP mb_subst...

pexelsphotohello5 文字長度太長,一般來說我們可以使用DIV包住字串,再定義DIV的...

文件上傳過程中使用白名單、黑名單、或者MIME做認證

文件上傳過程中使用白名單、黑...

pexelsphotolock5 是不是被資安的問題搞得很煩? 我想,在建置系統的過程中,或多或少都...

Please select an option

error

Hi, thank you for your participation, but you cannot vote repeatedly~

Join innstory now and start recording your story.

"Innstory" is a place to store stories. We are committed to becoming a warm platform. Deepening the bonds between people is our direction.
We are convinced that the blockchain between people is not just a cold calculation. Join us now.

Wrong format