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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:59:29+00:00 2026-06-17T20:59:29+00:00

I know I have seen this somewhere before, but I am trying to create

  • 0

I know I have seen this somewhere before, but I am trying to create a black fixed navbar with a marker that is transparent cut-out triangle. I need help getting the triangle cut-out to be transparent to the background, so when you scroll the page, you can see through to the content beneath:

I have a standard list/anchor navigation with a javascript to move the .current class depending upon the page section:

<div class="navbar">
<ul>
    <li class="current"><a>home</a></li>
    <li><a>products</a></li>
    <li><a>services</a></li>
    <li><a>contact us</a></li>
</ul>
</div>

styled with the following CSS:

.navbar {
    width: 100%;
    position: fixed;
    background: black;
    float: left;
}

ul, li {
    list-style: none;
    margin: 0;
    padding: 0;
    float: left;
}


a {
    padding: 10px 20px 20px;
}

.current a {
    background: transparent url('../img/wedge-red.png') center bottom no-repeat;            
}

The only way I can think to do it is to add extra divs on either side of the ul and assign the background to them, and then use a transparent png with a cutout as the background of the li a’s.

Is there a way to do this without getting really ugly like that, and adding extra divs?

  • 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-17T20:59:30+00:00Added an answer on June 17, 2026 at 8:59 pm

    Here’s what I ended up with — extending the borders and cropping them with overflow: hidden; (a little hacky, but it works and doesn’t add elements to the DOM):

        .navbar {
            width: 100%;
            height: 60px;
            position: fixed;
            overflow: hidden;
        }
    
    
        ul {
            border-left: solid black 2000px;
            border-right: solid black 2000px;
            position: absolute;
            top: 0;
            left: 50%;
            margin-left: -2000px;
        }
    

    The above worked nicely for my purposes, and behaves in a responsive environment.

    The other answer on this page, using :before and :after pseudo elements didn’t work for my purposes. It ended up being too fussy, the pseudo elements wouldn’t align properly, and kept wrapping to the next line when the browser window was resized. That solution as suggested works with fixed-width elements, not percentages as was specified in the original question.

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

Sidebar

Related Questions

I know I have seen this somewhere before, but I cannot find it again.
I know I have seen this problem before somewhere, but I'm not sure if
Okay i've seen this done somewhere before where you have a function that takes
I know I have seen an article this somewhere (specifically related to Azure too!)
I have seen this syntax in MSDN: yield break , but I don't know
I know this can be done and i have seen it done using some
Language Integrated Query. Now I know that the acronyms are. I have seen C#
I know we have ILdasm, but is there any tool out there that will
I know there have been some similar questions to this, but they haven't helped
I'm sure I've seen this done before but without knowing what it's called I'm

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.