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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T22:12:35+00:00 2026-06-16T22:12:35+00:00

Im trying to create a container with css that has a rectangle header with

  • 0

Im trying to create a container with css that has a rectangle header with a ‘triangle edge’.

Example:

chrome example

Or code here (css):

.bubble {
    clear: both;
    margin: 0px auto;
    width: 350px;
    background: #fff;
    -moz-border-radius: 10px;
  -khtml-border-radius: 10px;
  -webkit-border-radius: 10px;
    -moz-box-shadow: 0px 0px 8px rgba(0,0,0,0.3);
  -khtml-box-shadow: 0px 0px 8px rgba(0,0,0,0.3);
  -webkit-box-shadow: 0px 0px 8px rgba(0,0,0,0.3);  
    position: relative; 
    z-index: 90; /* the stack order: displayed under ribbon rectangle (100) */
}

div#container {
    margin: 50px auto 0px auto; /* centered */
    padding-top:100px;
    width: 400px;
}

.triangle {
   height: 35px;
   top: -20px;
   width: 315px;
   position: relative;
   background: #D12738;
   background: -moz-linear-gradient(top, rgba(209, 39, 56, 1) 0%, rgba(122, 23, 38, 1)    100%);
   background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(209, 39, 56, 1)), color-stop(100%,rgba(122, 23, 38, 1)));
   filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#d12738',  endColorstr='#7a1726',GradientType=0 ), filter:  progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000');
}

.triangle::after {
   -moz-transform: rotate(45deg);
   -ms-transform: rotate(45deg);
   -webkit-transform: rotate(35deg);
   -o-transform: rotate(45deg);
   background: none repeat scroll 0 0 white;
   content: "";
   height: 44px;
   left: 302px;
   position: absolute;
   top: 2px;
   width: 24px;
}

html:

<div id="container">
    <div class="bubble">
        <div class="triangle">test baa</div>
        <p>sadsadsadsad dsdsa dsdsa ds dsadsd</p>
        <p>sadsadsadsad dsdsa dsdsa ds dsadsd</p>
        <p>sadsadsadsad dsdsa dsdsa ds dsadsd</p>
        <p>sadsadsadsad dsdsa dsdsa ds dsadsd</p>

    </div>
</div>

But the border on the right edge dissapears because of the white background. Is there any way to prevent this?

Any help appreciated!

  • 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-16T22:12:35+00:00Added an answer on June 16, 2026 at 10:12 pm

    You can’t accomplish what you’re trying to do by creating a triangle with that method, because by definition you’re blocking out a piece of the rectangle with something that’s also going to block out whatever else is behind it.

    The way to accomplish what you want to accomplish is to create a triangle using a border. Here’s a link and a fiddle to how you might accomplish this:

    http://css-tricks.com/snippets/css/css-triangle/
    http://jsfiddle.net/BNVHU/7/

    Unfortunately, border gradients only work with webkit at this time, and don’t seem to jibe with the border method of making triangles. I doubt that there’s a way to do this with a gradient intact in all browsers. Might need an image.

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

Sidebar

Related Questions

I'm trying to create a very simple page that contains a container, a header,
I'm trying to create a GWT app that has two modules: WebModule - that
I'm trying to create a tab set using jQuery UI that has some permanent
I'm trying to create a centered, page container that will vertically stretch across the
I'm trying to create a css reset that targets only my control. So the
I'm trying to create a particular CSS button described here: http://www.2shared.com/file/5131551/412bd8a8/Sans_titre-1_copie.html Basically, it's a
I'm trying to create a Set that contains instances of 'Vertex3<T>'. I'm having a
i'm trying to create a frame that will contain a dynamic amount of text.
I'm trying to create a page that contains a grid and searching. The issue
I'm trying to create a tabpanel view that contains a splitview controller on the

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.