Skip to content

First word breaks unnecessarily at the end of the line #429

Closed
@mndzielski

Description

@mndzielski

Hi,
I use css word-wrap: break-word; to force long words to break. Unfortunately if at the end of line there is new html element like <b>text ...</b> first word breaks. If there is enough place situation doesn't appear for second word. In third case if I don't use word-wrap b element doesn't break.

HTML code:

<html>
<head>
<style>
.wrap {
	word-wrap: break-word;
}
</style>
</head>
<body>

<div class="wrap">
	1. OpenHTMLtoPDF OpenHTMLtoPDF OpenHTMLtoPDF OpenHTMLtoPDF OpenHTMLtoPDF <b>OpenHTMLtoPDF OpenHTMLtoPDF  OpenHTMLtoPDF OpenHTMLtoPDF</b>
</div><br/>
<div class="wrap">
	2. OpenHTMLtoPDF OpenHTMLtoPDF OpenHTMLtoPDF OpenHTMLtoPDF <b>OpenHTMLtoPDF OpenHTMLtoPDF OpenHTMLtoPDF OpenHTMLtoPDF</b>
</div><br/>
<div>
	3. OpenHTMLtoPDF OpenHTMLtoPDF OpenHTMLtoPDF OpenHTMLtoPDF OpenHTMLtoPDF <b>OpenHTMLtoPDF OpenHTMLtoPDF</b>
</div>
</body>
</html>

and the result:

image

What can I do to fix it?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions