html css word wrap,css - word wrap on html paragraph - Stack Overflow

I have a paragraph tag inside a table, and for example it has a text like this...

4: asldkflaksdjflks, lasjdlfjsaldfjasldjfoajsdkfjaslkdjlkfasjdfwoidjfalk,zmncv,mznoqeworjoiejflaksdlfjwaf

How can the text wrap something like this..

4: asldkflaksdjflks, lasjdlfjsaldfjasldjfoajsdkfjaslkdjlkfasj

dfwoidjfalk,zmncv,mznoqeworjoiejflaksdlfjwaf

I have tried word-wrap:break-word; but it doesn't seem to work. I'm using IE8

Here is my css:

#notes table tr td p{

font-family:Arial;

padding:2% 2% 2% 5%;

table-layout: fixed;

word-wrap: break-word;

Update 1

I was wrong with my question. Sorry about that. I want the text not to wrap, even though there is a white-space. But it will go down to the next line if necessary. Hope that I'm clearer this time.

Is there a character that looks like a space, but doesn't serve as a breakpoint for the word wrap?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是一个简单的示例,演示如何使用 HTMLCSS 制作 Word 效果: HTML 代码: ```html <!DOCTYPE html> <html> <head> <title>My Word Document</title> <style> body { font-family: Arial, sans-serif; font-size: 12pt; line-height: 1.5; margin: 0; padding: 0; } h1, h2, h3 { margin: 0; } h1 { font-size: 24pt; font-weight: bold; text-align: center; margin-top: 2cm; margin-bottom: 2cm; } h2 { font-size: 18pt; font-weight: bold; margin-top: 1cm; margin-bottom: 0.5cm; } p { margin: 0; text-indent: 2em; } ul { margin: 0; padding-left: 2em; } .page-header, .page-footer { position: fixed; left: 0; right: 0; height: 1cm; background-color: #ccc; text-align: center; font-size: 10pt; line-height: 1cm; } .page-header { top: 0; } .page-footer { bottom: 0; } </style> </head> <body> <div class="page-header"> Page Header </div> <div class="page-footer"> Page Footer </div> <h1>My Word Document</h1> <h2>Section 1</h2> <p>This is the first paragraph of section 1.</p> <p>This is the second paragraph of section 1.</p> <h2>Section 2</h2> <ul> <li>List item 1</li> <li>List item 2</li> <li>List item 3</li> </ul> </body> </html> ``` CSS 代码: ```css body { font-family: Arial, sans-serif; font-size: 12pt; line-height: 1.5; margin: 0; padding: 0; } h1, h2, h3 { margin: 0; } h1 { font-size: 24pt; font-weight: bold; text-align: center; margin-top: 2cm; margin-bottom: 2cm; } h2 { font-size: 18pt; font-weight: bold; margin-top: 1cm; margin-bottom: 0.5cm; } p { margin: 0; text-indent: 2em; } ul { margin: 0; padding-left: 2em; } .page-header, .page-footer { position: fixed; left: 0; right: 0; height: 1cm; background-color: #ccc; text-align: center; font-size: 10pt; line-height: 1cm; } .page-header { top: 0; } .page-footer { bottom: 0; } ``` 此示例定义了页面的样式和布局,并包括一个页眉和页脚。请尝试将此代码复制到 HTMLCSS 文件中,并在浏览器中查看结果。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值