Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8785959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:29:12+00:00 2026-06-13T21:29:12+00:00

I need to implement the following markup: The problem is that I can use

  • 0

I need to implement the following markup:
enter image description here

The problem is that I can use only HTML+CSS and XSLT to produce it.

I thought of writing a template that would split the text into lines with XSL and print each line as a different paragraph <p> with border-bottom set. Is there a simpler way to achieve this by means of HTML+CSS?

A small update: The point here is to have this underline extend past the text and take all the available width. So all lines are of the same length (like lines in a copybook), except the first one which may be shorter

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T21:29:13+00:00Added an answer on June 13, 2026 at 9:29 pm

    You can use an inline element such as <span> which will treat border-bottom like underline:

    <p>
        <span>
            <del>Lorem ipsum dolor sit amet, consectetur adipisicing elit,</del> sed do
    eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam
        </span>
    </p>
    

    and CSS:

    span {
        border-bottom: 4px solid black;
    }
    del {
        color: red;
    }
    

    Demo here.

    Result using the markup above:

    result in Chrome

    EDIT:

    1.

    Extending @aefxx’s answer, if you can use CSS3 try this:

    .strike {
        background-image: -moz-linear-gradient(top , rgba(255, 255, 255, 0) 34px, #000000 34px, #000000 38px);
        background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0) 34px, #000000 34px, #000000 38px);
        background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0) 34px, #000000 34px, #000000 38px);
        background-repeat: repeat-y;
        background-size: 100% 38px;
    }
    p {
        line-height: 38px;
    }
    p:before {
        background: #fff;
        content:"\00a0";
        display: inline-block;
        height: 38px;
        width: 50px;
    }
    del span {
        color: red;
    }
    

    ​Demo here – this will only work in the latest browsers including Firefox and Chrome.

    Result in Chrome:

    result using gradient


    2.

    If you’re happy with justified text:

    p,span {
        border-bottom: 4px solid black;
        line-height: 30px;
        text-align: justify;
        text-indent: 50px;
    }
    p>span {
        padding-bottom: 5px;
        vertical-align: top;
    }
    del span {
        border-bottom: 0 none;
        color: red;
    }
    

    Demo here. ​There are some issues with line-height but should be easy to figure out.

    Result in Chrome:

    enter image description here


    Other than that, I’m afraid you might have to wrap your lines in some containers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

we need to implement the following query in such a way that we should
I have the following C++ code that I need to implement merge-sort with. Its
I need to implement a remote management system that does the following tasks on
I need to implement the following flow in my application: the user can click
Problem description: I need to implement 2 classes like following: class A1 { common_method1();
I have the following query and I need to implement a Mailer that needs
I need to implement following categorization in SQL: group can contain multiple tests or
I need a container that implements the following API (and need not implement anything
I am learning and using Web API and need to implement following Authentication mechanism
I need to implement the following: There is a table A which is supposed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.