DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> CSS入門知識 >> DIV十CSS布局 >> 布局實例 >> 用CSS使長串英文字符自動換行
用CSS使長串英文字符自動換行
編輯:布局實例     

在一個單元格內,中文字符如果超出了單元格的寬度,都會自動換行。但奇怪的是,如果全是英文的話,不論你將TD的寬度設為多大,英文字符都不會自動換行,只會一直延伸。如果做英文站點,動態輸出內容,這個就麻煩了。
    幸好有個簡單的辦法可以解決:就是用CSS。只需用到:word-break:break-all就可以了。

    例如:

<table style="table-layout:fixed">
<tr>
<td width="100" style="word-break:break-all">Mistletoe also known throughout history as the golden bough has several different legends associated with its beginning and its meaning. 

Starting back as far as the Celtic Druids you can find more than one story concerning the mystical mistletoe. One such story is their belief that the plant held the soul of the host tree, which was the “holy oak”. During a ceremony, the Druid priests would harvest the mistletoe with a golden sickle to ensure the mistletoe never touched the ground, as it would lose its magical powers. The powers would quickly be absorbed back into the earth. Once the mistletoe was harvested, the priests would have the branches out to the people for them to use against all kinds of evils.

In England, mistletoe at one time was placed over the doorways for good luck. They believed that only happiness could pass underneath the mistletoe, therefore, enemies would hug and seal their peaceful intentions with a kiss of friendship. 

all by <a href=http://www.qpsh.com>www.qpsh.com</a>

The ancient Norse people have a wonderful legend centered on the mistletoe. In their legend, the god Odin and his wife Frigga had a son by the name of Balder. Frigga loved her son very dearly. She took steps to ensure that nothing would ever harm him by way of earth, fire, water, or air. 

The mistletoe did not fit into any of these categories, so an evil spirit by the name of Loki created an arrow out of mistletoe and gave it to Balder’s brother, Holder. Holder was blind and Loki held onto his hand and shot Balder in the heart with the mistletoe arrow. Balder died.

From this moment on, the legend is told differently in various stories. One is that Balder is brought to life. In another one, he had a Viking’s funeral and was sent to the Otherworld on a burning ship. He was to remain there until it was time for him to come back to earth to start a new era. 

From that day, forward, Frigga stated the mistletoe would never harm anyone again and made it a symbol of love and made the promise to bestow a kiss upon everyone who passed beneath it.
</td>
</tr>
</table> 

XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved