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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:02:43+00:00 2026-05-28T02:02:43+00:00

Take a look at this fiddle – I’ve got three divs which all have

  • 0

Take a look at this fiddle – I’ve got three divs which all have a border-width of 2px. The original problem was because each div has a border-width of 2px, the border gets duplicated in between each div, giving a total border-width of 4px. I fixed this by adding a margin-top of -2px on every div. This causes the divs to cover up the border of the one above, achieving what looks like even borders all round.

I wanted to add a hover effect to my divs, so I added the following CSS:

#main div:hover {
    border-color:#09C;
}

The trouble is, because the borders of the top two are covered up by the divs below them, the hover effect doesn’t look right (the bottom border of each div doesn’t appear to get highlighted).

I want to be able to have a 2px border only between each div, whilst having a hover effect for the entire border of that div… how can I do this?

  • 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-05-28T02:02:44+00:00Added an answer on May 28, 2026 at 2:02 am

    You can add another selector that colors the top border of the next div when a div is hovered:

    #main div:hover + div {
        border-top-color:#09C; 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Take a look at this fiddle: JsFiddle As you can see I have put
Please take a look at this fiddle: http://jsfiddle.net/d3uc9/4/ I have a problem with this,
Take a look at this fiddle which shows a sample menu that I've written.
Please take a look at this fiddle . My goal is to have a
Hi please take a look at this fiddle http://jsfiddle.net/bloodygeese/pwjNQ/1/ I am trying to figure
Take a look at this fiddle: http://jsfiddle.net/BramVanroy/tKL8E/ When you hover contact and then to
Take a look at this sample: http://jsbin.com/imivek/1/edit Clicking the text field, which is part
Take a look at this fiddle: http://jsfiddle.net/PRz4G/ You can see four white points about
Take a look at this fiddle: http://sqlfiddle.com/#!6/18324/2 Expand the very first execution plan, for
Please take a look at this fiddle: http://jsfiddle.net/dhcyA/ Try clicking on a block. What

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.