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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:45:24+00:00 2026-06-16T04:45:24+00:00

I am building a navigation bar and need to have a bracket inserted before

  • 0

I am building a navigation bar and need to have a bracket inserted before the button and after the button to highlight the button when hovered and selected as below example

[  Button 1  ]    button 2    button 3    button 4

I am using an image for the bracket width=7px height=30px. My CSS is limited and I’m teaching myself! I have managed to get it all to work if I use position: relative as below

#np-access a:hover:before{ 
  content: url(images/bracket-left.png); 
  position:relative;
  top: 10px; 
}

#np-access a:hover:after {
   content: url(images/bracket-right.png); 
   position:relative;
   top: 10px;
}

But this causes the navigation to ‘bounce’ , button moves to the right when hovered over.
I changed this and used position: absolute which works, however the brackets display over the text (narrow) . To spread them apart a bit, I’ve added left: 0.5px for :before and right: 0.5px for :after which works, but the first bracket is missing and the others appear ok but are too close ie button 2 right bracket is too close to button 3 left bracket (no padding), but they function correctly (example below).

   button 1  ][   button 2   ][  button 3  ][  button 4  ]

To try and add some padding to the brackets (button 2 right bracket too close to button 3 left bracket) I increased the padding for the anchor attribute from 1.5em to 2em but the brakets followed, and the appearance stayed the same

#np-access a {
color: #5F5B5B; 
display: block;
line-height: 3.333em;
padding: 0 1.5em;
text-decoration: none;


}

Why is the first bracket missing when using position absolute? And how do I add padding? Hope someone can offer an explanation as to where I am going wrong! Thanks in advance my CSS is below

#np-access .current-menu-item > a:after,
#np-access .current-menu-ancestor > a:after,
#np-access .current_page_item > a:after,
#np-access .current_page_ancestor > a:after {
 content: url(images/bracket-right.png); 
 position:absolute;
 right: 0.5px;
 top: 10px;
}

#np-access .current-menu-item > a:before,
#np-access .current-menu-ancestor > a:before,
#np-access .current_page_item > a:before,
#np-access .current_page_ancestor > a:before {
     content: url(images/bracket-left.png); 
     position:absolute;
     left: -0.5px;
     top: 10px; 
}


#np-access a:hover:before{ 
    content: url(images/bracket-left.png); 
    position:absolute;
    left: -0.5px;
    top: 10px; 
}

#np-access a:hover:after {
    content: url(images/bracket-right.png); 
    position:absolute;
    right: 0.5px;
    top: 10px;

}

code which now works

#np-access a:hover:before{ 
   content: url(images/bracket-left.png); 
    position:absolute;
    left: 1px;
    top: 10px; 
    padding: 0 10px;
 }

 #np-access a:hover:after {
    content: url(images/bracket-right.png); 
    position:absolute;
    right: 0.5px;
    top: 10px;
    padding: 0 10px;
  }

Thanks dagfr!

  • 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-16T04:45:25+00:00Added an answer on June 16, 2026 at 4:45 am

    The -0.5px left cause the first bracket to be out of the page.

    Why don’t have left:0 right:0 on :before and :after but a padding added to #np-access a:hover like padding: 0 3px; ??

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

Sidebar

Related Questions

Basically, I am building a horizontal navigation bar. I have following markup: <ui:style src=../common.css
I am using Bootstrap v2.0.2 . Below is the navigation bar I am building
i'm building my own navigation between views and i have the navi bar hidden
I'm building a navigation system using jquery scrollto. I have my navigation menu in
I'm building a website, and would like to make aa navigation bar with submenus.
I am building a navigation bar which will be located at the top of
I am building a navigation bar for my website . This navigation bar elements
I am building a dynamic filtering navigation bar for use with the isotope items
I'm building a site with a simple navigation bar. I've written some CSS to
I'm building a SL4 app. I have two controls, a top search bar and

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.