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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:11:00+00:00 2026-05-27T14:11:00+00:00

Shouldn’t the content of my container be cut off when the container has border-radius

  • 0

Shouldn’t the content of my container be cut off when the container has border-radius?

Sample HTML and CSS:

.progressbar { height: 5px; width: 100px; border-radius: 5px; }
.buffer { width: 25px; height: 5px; background: #999999; }
<div class="progressbar">
    <div class="buffer"></div>
</div>

As you can see I use border-radius on the container (.progressbar), but the content (.buffer) goes ‘outside’ the container. I’m seeing this on Google Chrome.

Is this the expected behavior?

P.S. This isn’t about how to fix it, this is about whether it should work like this.

  • 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-27T14:11:01+00:00Added an answer on May 27, 2026 at 2:11 pm

    Is this the expected behavior?

    Yes, as crazy as it sounds, it actually is. Here’s why:

    The default overflow for <div> elements (and most other things) is visible, and the spec says this about overflow: visible:

    visible
    This value indicates that content is not clipped, i.e., it may be rendered outside the block box.

    In turn, §5.3 Corner clipping in the Backgrounds and Borders module says:

    A box’s backgrounds, but not its border-image, are clipped to the appropriate curve (as determined by ‘background-clip’). Other effects that clip to the border or padding edge (such as ‘overflow’ other than ‘visible’) also must clip to the curve. The content of replaced elements is always trimmed to the content edge curve. Also, the area outside the curve of the border edge does not accept mouse events on behalf of the element.

    The sentence that I’ve emphasized specifically mentions that the overflow value of the box must be something other than visible (that means auto, hidden, scroll and others) in order for the corners to clip its children.

    If the box is defined to have visible overflow, which like I said is the default for most visual elements, then the content is not supposed to be clipped at all. And that’s why the square corners of .buffer go over the rounded corners of .progressbar.

    Consequently, the simplest way to get .buffer to clip within .progressbar‘s rounded corners is to add an overflow: hidden style to .progressbar, as shown in this updated fiddle.

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

Sidebar

Related Questions

This shouldn't be hard...I have a menu and some content wrapped in a centered,
This shouldn't work: page: #{extends 'master.html'/} #{set parameter:foo.bar/} //foo is passed from contoller master.html:
I know destructor shouldn't not throw exception. http://www.parashift.com/c++-faq-lite/dtors.html#faq-11.13 I have the following code :
I think we shouldn't have references to html elements in viewmodel. So I think
Shouldn't we use Pixel for anything in CSS if we are making a site
Shouldn't this be a pretty straightforward operation? However, I see there's neither a size()
Shouldn't PostBack be checked before Session protected void Page_Load(object sender, EventArgs e) { if
Shouldn't classes in DAL (customerDAL) be singleton? Since my controllers (customerController) exposes Shared Subs,
Shouldn't the compiler automatically cast to a double in the following? At least according
Shouldn't I be able to call this CoffeeScript method from within an erb template?

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.