Announcement

Collapse
No announcement yet.

Non-breaking text within a paragraph

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Non-breaking text within a paragraph

    I'm looking for an HTML tag that specifies that the text enclosed within the tag boundaries is not to be broken up across lines within a paragraph. For example, one could use this hypothetical "sometag" tag to do <sometag><code>i++; // hello</code></sometag>. This would ensure that the little piece of code wouldn't get split across a line boundary within the paragraph that it's contained in. Got any ideas?

  • #2
    Is it this what you are looking for?

    <nobr>Your text</nobr>

    This would ensure that "Your text" will always be displayed on one line.

    Comment


    • #3
      Thanks, <nobr> appears to be exactly what I'm looking for, except for one thing: it's not part of HTML 4.0.1. It is supported by Internet Explorer and Netscape, but I'd still rather use something that is in HTML 4.0.1.

      Comment


      • #4
        Try

        <span style="white-space: nowrap">Text</span> .

        I am reading a book about CSS at the moment and I remembered your post when I read the description of that .

        Comment


        • #5
          Originally posted by Icheb
          Try

          <span style="white-space: nowrap">Text</span> .

          I am reading a book about CSS at the moment and I remembered your post when I read the description of that .
          I think that that too is a Microsoft extension and is not part of HTML 4.0.1.

          Comment

          Related Topics

          Collapse

          Working...
          X