| <!DOCTYPE html> |
| <!-- |
| | When the "text-overflow" property is set to "ellipsis" an ellipsis |
| | character is rendered to represent clipped inline content. |
| | "The first character or atomic inline-level element on a line must |
| | be clipped rather than ellipsed." As a result of this, the margin of |
| | a span that precedes the first character or atomic inline-level |
| | element must also be clipped and not ellipsed. |
| | https://www.w3.org/TR/css3-ui/#propdef-text-overflow |
| --> |
| <html> |
| <head> |
| <meta charset="utf-8"> |
| <style> |
| body { |
| margin: 0; |
| font-family: Roboto; |
| font-size: 16px; |
| font-weight: normal; |
| color: #fff; |
| } |
| #div1 { |
| white-space: nowrap; |
| width: 180px; |
| overflow: hidden; |
| text-overflow: ellipsis; |
| border: 1px solid #000000; |
| } |
| span { |
| width: 80px; |
| margin: 200px; |
| } |
| </style> |
| </head> |
| <body> |
| <div> |
| <div dir="ltr" id="div1"><span>test</span> interesting</div> |
| <div dir="rtl" id="div1">interesting <span>test</span></div> |
| </div> |
| </body> |
| </html> |