设为首页 加入收藏

网页制作特效代码园地

综合应用 菜单特效 状态拦类 文本操作 窗口页面 图形特效 鼠标特效 时间日期 警告对话 按钮特效

您当前位置:网页特效代码 - div+css

用CSS使长串英文字符自动换行

www.qpsh.com  更新日期:2007-12-23  人气指数 2185


    在一个单元格内,中文字符如果超出了单元格的宽度,都会自动换行。但奇怪的是,如果全是英文的话,不论你将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> 

返回首页】【刷新本页】【返回顶部】【关闭本页

CopyRight  ©  网页特效代码 2006 - 2007 Qpsh.Com All rights reserved