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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:58:38+00:00 2026-05-28T03:58:38+00:00

Creating a DIV that uses CSS to draw a triangle to the left. Trying

  • 0

Creating a DIV that uses CSS to draw a triangle to the left. Trying to apply a uniform box-shadow to both parent and the pseudo element (see images) and code.

Is this possible? Or am I better off using border-image for this?

(Top: Before Shadow, Middle: CSS Box-Shadow, Bottom: Desired Result)

Elements Before Box-Shadow is added

Elements with box-shadow added

The desired result

.bubble{
    height: 200px;
    width:  275px;

    opacity: 0;

    margin-top: 41px;

    float: right;

    background-color: #F2F2F2;

    -webkit-border-radius: 5px;
    -webkit-box-shadow: 0px 0px 6px #B2B2B2;
}

.bubble::after {
        height: 0px;
        width:  0px;

        content: "\00a0";

        display: block;

        margin-left: -10px;
        margin-top:   28px;

        border-width: 10px 10px 10px 0;
        border-style: solid;
        border-color: transparent #F2F2F2 transparent transparent;

        -webkit-box-shadow: 0px 0px 6px #B2B2B2;
    }
  • 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-28T03:58:39+00:00Added an answer on May 28, 2026 at 3:58 am

    Instead of using a triangle hack, you can just rotate a div using transform and get a real box-shadow. Since you only want the shadow on one side of the div (the visible triangle side), you have to make the blur smaller and lower the opacity.

    Demo: http://jsfiddle.net/ThinkingStiff/mek5Z/

    HTML:

    <div class="bubble"></div>
    

    CSS:

    .bubble{
        background-color: #F2F2F2;
        border-radius: 5px;
        box-shadow: 0px 0px 6px #B2B2B2;
        height: 200px;
        margin: 20px;
        width:  275px;
    }
    
    .bubble::after {
        background-color: #F2F2F2;
        box-shadow: -2px 2px 2px 0 rgba( 178, 178, 178, .4 );
        content: "\00a0";
        display: block;
        height: 20px;
        left: -10px;
        position: relative;
        top: 20px;
        transform:             rotate( 45deg );
            -moz-transform:    rotate( 45deg );
            -ms-transform:     rotate( 45deg );
            -o-transform:      rotate( 45deg );
            -webkit-transform: rotate( 45deg );
        width:  20px;
    }
    

    Output:

    enter image description here

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

Sidebar

Related Questions

I have a jQuery UI Dialog box, that I'm creating. It starts out as
I have a DIV that gets its height from a CSS class in a
I am creating a dynamic div using Jquery and I am trying to cache
I'm creating a series of div boxes that lets users add/remove items from each
I am creating a page that uses AJAX to switch content, and each of
I am creating a webpage that have a transparent div. I want to add
I'm creating a mosaic tile wall that uses the jQuery plugin Flip! (http://lab.smashup.it/flip/) to
What's the best approach to creating a div that will take the full width
I'm creating a simple sliding motion. But the div that is sliding in is
The idea: I'm creating a div that will change to position:fixed once the top

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.