Skip to main content
Inspiring
January 4, 2017
Answered

Continuous Text Underline

  • January 4, 2017
  • 4 replies
  • 2044 views

If I select a couple of works and then select Underline, it only underlines the individual letters. How can I have a continuous underline?

BTW I did a search but all the results were related to underlined links.
Thanks
Alan

    This topic has been closed for replies.
    Correct answer Jon Fritz

    Unless you're doing something exceptionally weird with your html, text-decoration:underline or the <u> tag will underline the entire word, or group of words, with a continuous line.

    You may be having a display driver issue if the underline is only showing on individual letters.

    How does it appear in each browser?

    4 replies

    Legend
    January 4, 2017

    English100 wrote:

    If I select a couple of works and then select Underline, it only underlines the individual letters. How can I have a continuous underline?

    BTW I did a search but all the results were related to underlined links.
    Thanks
    Alan

    Wrap the words in a <span></span> tag and then style it with css, example below:

    <!DOCTYPE html>

    <html>

    <head>

    <meta charset="UTF-8" />

    <title>Underlined Words</title>

    <style>

    .underline_text {

    padding: 0 0 2px 0;

    border-bottom: 1px solid #000;

    }

    </style>

    </head>

    <body>

    <p>This paragraph of <span class="underline_text">text contains a group of underlined</span> words</p>

    </body>

    </html>

    Jon Fritz
    Community Expert
    Jon FritzCommunity ExpertCorrect answer
    Community Expert
    January 4, 2017

    Unless you're doing something exceptionally weird with your html, text-decoration:underline or the <u> tag will underline the entire word, or group of words, with a continuous line.

    You may be having a display driver issue if the underline is only showing on individual letters.

    How does it appear in each browser?

    Inspiring
    January 4, 2017

    Yes that's what it was. I use underline to emphasize my chapter headings (I write stories and post the on a website? so there is no confusion as my stories don't contain links.

    Thanks

    Alan

    Nancy OShea
    Community Expert
    Community Expert
    January 4, 2017

    If you absolutely must, use the CSS border property instead.

    Incidentally, underlining text in HTML documents is highly discouraged as it implies the underlined text is a hyperlink to more content.   A web page is nothing like a printed page and vice versa.  They each have different presentation rules.

    Nancy

    Nancy O'Shea— Product User & Community Expert
    Jon Fritz
    Community Expert
    Community Expert
    January 4, 2017

    How are you adding the underline exactly?