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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:46:46+00:00 2026-06-15T02:46:46+00:00

I am trying to create a div that slants only at the top and

  • 0

I am trying to create a div that slants only at the top and does not skew the text within it, using CSS.
The reason I would like for it to be CSS-only is because it is a responsive design and needs to respond to percentages, as the rest of this div flexes as the device width changes.

A photo of what I am trying to accomplish is here:

Slanted design

What I have gotten so far is to create a skewed div and position it within the other div, then use a negative margin to pull it upwards. There are two issues with this way that I’ve done this. The first issue is that on the smallest screen shrinkage (make your browser width really small), the skewed div becomes smaller than the containing div, making it look odd. Also, this div is covering up any text I am adding after it.

The markup:

<aside>
                <div id="skew"></div><!-- #skew -->
                <h3 id="refer">Refer Your Friends</h3>
</aside>

The CSS:

   #skew {
background:#00328b;
width:103%;
height:66px;
border-radius:8px;
margin-top:-47px;
margin-left:-1.2%;
  -webkit-transform: skewY(-5.5deg); 
 -moz-transform: skewY(-5.5deg); 
  -ms-transform: skewY(-5.5deg); 
   -o-transform: skewY(-5.5deg); 
      transform: skewY(-5.5deg); 
}

.main aside {
color: white;
padding: 20px 10px;
margin-top:120px;
border-radius:8px;
background: rgb(0,51,141); /* Old browsers */
}

I have tried using the skew on the parent aside, but this skews all child elements within it. If this were a fixed layout, I would use absolute positioning to help me, but since it is responsive and flexes, I don’t know what other approach to take.

I also would like for it to be in CSS because I have other effects to add to the div, such as an outer glow using box-shadow, and a background gradient.

I also cannot change the design.

Any input on how to accomplish this would be great!

  • 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-15T02:46:47+00:00Added an answer on June 15, 2026 at 2:46 am

    Skew the box one way, and its contents the other:

    <aside class="skew-neg">
        <div class="skew-pos">
            <p>Hello World.</p>
            <p>@jonathansampson.</p>
            <p>This box is skewed.</p>
            <p>In supported browsers.</p>
        </div>
    </aside>
    
    /* Skew the container one way */
    .skew-neg {
        -webkit-transform: skewY(-5deg);
        -moz-transform: skewY(-5deg);
        -ms-transform: skewY(-5deg);
        -o-transform: skewY(-5deg);
        transform: skewY(-5deg);
    }
    
    /* And the child another way */
    .skew-pos {
        -webkit-transform: skewY(5deg);
        -moz-transform: skewY(5deg);
        -ms-transform: skewY(5deg);
        -o-transform: skewY(5deg);
        transform: skewY(5deg);
    }
    

    Which results in something similar to the following:

    enter image description here

    Demo: http://jsfiddle.net/Q7dKT/191/

    • 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 the illusion of a multiselect dropdown using a div that
I am trying to create a div that is scrollable only when it's above
I'm trying to create a div with a fixed size that contains images only.
I'm trying to create a new div each time a text field contained in
I am trying to create a jQuery click function that will close a div
Trying to create a div that is revealed below a link that slides to
I am trying to create a div that starts 200px from the left and
I am trying to create a div element which shows some text as popup.
I'm trying to create a editable textbox with HTML/CSS/Javascript that looks and functions like
I am trying to create some div (that should be buttons) that have rounded

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.