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

  • SEARCH
  • Home
  • 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 8963735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:25:26+00:00 2026-06-15T16:25:26+00:00

I have a #comments element which contains .comment elements. I would like to have

  • 0

I have a #comments element which contains .comment elements. I would like to have 5 vertical lines from left to right, each 1px in width, 100% height (till the end of the #comments element), with 20px between them and without images. I tried to do that myself, but my CSS-fu isn’t that high. Any help would be much appreciated.

HTML:

<div id="comments">
    <div class="comment level1">Lorem ipsum dolor sit amet</div>
    <div class="comment level2">Lorem ipsum dolor sit amet</div>
    <div class="comment level3">Lorem ipsum dolor sit amet</div>
</div>

CSS:

#comments {
    width: 400px;
    border: 1px solid black;
}
.comment {
    margin: 10px 0;
}
.level1 {}
.level2 { margin-left: 20px; }
.level3 { margin-left: 40px; }

Demo.

Here’s how I imagine it:

|[comment      ]
|  |[comment   ]
|  |[comment   ]
|  |  |[comment]
  • 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-15T16:25:27+00:00Added an answer on June 15, 2026 at 4:25 pm

    Is there some reason you need to have all the divs as direct children of the outer parent div? If you nest the divs you can accomplish this very easily:

    css:

    div div {
        border-left: 1px solid black;
        padding-left:20px;
    }
    

    nested html

    <div id="comments">
        <div>Lorem ipsum dolor sit amet</div>
        <div>Lorem ipsum dolor sit amet
            <br/>
            <div>Lorem ipsum dolor sit amet
                <br/>
                <div>Lorem ipsum dolor sit amet
                    <br/>
                    <div>Lorem ipsum dolor sit amet</div>
                    <div>Lorem ipsum dolor sit amet
                       <br/>
                       <div>Lorem ipsum dolor sit amet</div>                
                    </div>
                </div>
            </div>
        </div>
    </div>
    

    updated fiddle showing how it would look here nested down to 5 levels:

    http://jsfiddle.net/webchemist/tuZB6/4/

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

Sidebar

Related Questions

I have an element which displays a comment form, the action is comments/add. If
I have a POST model and a COMMENT model. In my Comments element i
I have Comments for something and it's possible to like them. The likes are
How to automatically format PhpDoc comments in Netbeans? I'd like to have comments aligned
A user can create a post. Posts have comments. A comment must belong to
Sometimes I want to have temporary comments fully left justified on a line (//)
I currently have a website source code (no control over the source) which contains
I have a page in JQuery mobile, which contains a form. The form has
I have an XML containing blog posts. Each post contains a date node. I
I have a Add view which uploads file which is element of Question class

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.