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 9270795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:27:31+00:00 2026-06-18T15:27:31+00:00

For setting a border line between elements, I use border on one side for

  • 0

For setting a border line between elements, I use border on one side for each child, except the last one. For example

<div class="parent">
   <div>First</div>
   <div>Second</div>
   <div>Third</div>
   <div>Fourth</div>
</div>

with CSS

.parent div{
    display:block;
    padding:5px;
    border-bottom:dashed 1px #000}
.parent div:last-child{
    border-bottom:dashed 0 #000
}

Is there a way to set the border between children from parent’s CSS style? without using last-child. In other words, in one single statement from parent rule.

  • 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-18T15:27:32+00:00Added an answer on June 18, 2026 at 3:27 pm

    No, the border is a property of the child element, and thus can only be specified on them. You can use a single rule for this, but it requires advanced CSS3 selector support:

    .parent > div:not(:last-child){
        border-bottom: dashed 1px #000;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm using a empty div to display a line by setting height 3px .
I'm trying to display two <div> elements on the same line, but in the
I have two divs placed inside a larger div. Each one of these two
Setting up new git installations. On one Windows laptop, I'm running (under cygwin): git
I would like to have a border for the table with class name as
I am creating a Jquery accordion from the following HTML <div class=title><a href=javascript:void(0)>Title goes
I've tried everything but nothing short of setting the outer-most table's border to 0
I have a strange situation in one view controller where this line crashes in
Setting line won't appear on top of the background color,what seems to be the
In my CSS, I defined the #error div as: #error { border-width:1px; border-style:solid; border-color:

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.