The border-radius of a nested div is causing an overlap within another div

Currently, I am working on developing this card utilizing React, HTML, and CSS

Take a look at my code snippet:

<div className="plan">
  <div className="plan-name">
    <h5>BASIC</h5>
  </div>
  <div className="plan-price">
    <h2>$ 6.99</h2>
    <span>Screen Availabilty Simultaneously</span>
  </div>
  <div className="plan-details">
    <ul>
      <li>
        <span>
          <CheckIcon /> 
        </span>
        Access to All Library in Unlimited
      </li>
      <li>New Content Monthly</li>
      <li>Available on PC, Smartphones and tablet</li>
      <li>Drawing in Color</li>
      <li>Color in Very High Quality</li>
      <li>Canceable at Any Time</li>
    </ul>
  </div>
</div>

CSS Styles:

.plan {
    border-radius: 25px;
    overflow: hidden;
    background-color: #fff;
}

.plan-name {
    background-color: #3e104f;
    padding: 25px 0;
    border-style: solid;
    border-width: 0;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
}

.plan-price {
    color: #3e104f;
    background-color: #fff;
    padding: 35px 0;
}

.plan-details {
    background-color: #3e104f;
    height: 100%;
    border-radius: 20px;
}

Resulting Output:

However, I have encountered an issue with the appearance of an unexpected white border around all corners as highlighted above. Does anyone have any insights on what might be causing this or how I can resolve it effectively?

Answer №1

There's no need to worry, your CSS is perfectly fine.

A potential solution could involve the following adjustments:

.plan {margin-top: 25px; overflow: visible;} /* simply remove overflow: hidden so that .plan-name is displayed outside of .plan */
.plan-name {margin-top: -25px; border-top-right-radius: 25px; border-top-left-radius: 25px;}

By implementing this code, the radius of .plan will no longer be concealed by .plan-name, making the corners visible.

Answer №2

Simply including .plan {overflow: auto;} in the code solved the issue for me too

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Is it possible to save an HTML5 Canvas screenshot directly onto the page?

After browsing numerous tutorials on saving HTML5 canvas screenshots as images and opening them in new tabs, I'm wondering if there's a way to display the captured screenshot in a pre-set div on the SAME WEBPAGE. Any suggestions or solutions woul ...

The Hamburger Menu Opens Smoothly But Refuses to Shut Down

Below is the HTML code for my website. I have managed to open the hamburger menu with the code, but I am facing an issue where it won't close. I have checked the HTML structuring using a validator and found no errors. Additionally, I have reviewed my ...

generating the <tr> element within a loop

I've been working on creating a calendar, but I'm facing an issue with the way the days are laid out horizontally. Here's how it currently looks: https://i.sstatic.net/PWcCi.png As you can see, only the <td> tags have been created. I ...

What is the best way to create a paginator class that can navigate one page at a time using HTML and CSS?

I recently found the infusion theme online and you can check out some examples of it here There is also a live preview available here However, I am encountering difficulties in getting the paginator class to move. It seems like when one of those elements ...

AngularJS: intercepting custom 404 errors - handling responses containing URLs

Within my application, I have implemented an interceptor to handle any HTTP response errors. Here is a snippet of how it looks: var response = function(response) { if(response.config.url.indexOf('?page=') > -1) { skipException = true; ...

Tips for showcasing HTML as code tailored to certain programming languages

While browsing the web, I stumbled upon a website that had SQL code displayed with specific classes and styles applied to it. For example, table names were colored blue when inspected. Here is a glimpse of what I encountered: https://i.sstatic.net/WAacj.p ...

Retrieving data from a React state in one component and utilizing it in a separate component

Thank you for taking the time to assist me with this challenge. I am currently working on a project that involves creating the state goodData in one component called AddProduct and accessing it in another component named ActionBox, both within the same j ...

Is there a way to set a higher priority over the "!important" rule on my website?

I'm encountering a strange issue with my website. I have been working on this website and am looking to change the color of the main menu hover links from white to orange. Here is the CSS related to that section: .darkheader .navigation > ul > ...

What is the best way to refresh existing data retrieved by React Query without having to fetch everything again?

My current code structure requires me to refetch all the data after a successful mutation, as the client-side tasks are not updated automatically. Is there a way to update the tasks directly when I create or delete a task? const { data: sessionData } = ...

CSS: Maintain rounded corners on body border even when scrolling

I am attempting to create a body border on my webpage with rounded corners at the top to simulate the MacOS interface in the browser, similar to the image shown here: https://i.sstatic.net/ECSU9.jpg The issue arises when I scroll, and the top corners van ...

Adjustable height for Material UI tab components

I encountered an issue that I initially thought was related to the general configuration of my app and the height I assigned to my page wrapping classes. However, after creating a simple out-of-the-box material UI tab example, it became clear that this beh ...

Mozilla Firefox is having trouble rendering HTML elements

While a webpage loads perfectly in Chrome, it seems to be causing some issues in Firefox. Can someone please shed some light on what the problem might be and suggest a solution? Please visit this Link in both Chrome and Firefox to see the difference. Chr ...

Instructions for adding a button to each row in MUI X DataGrid

Struggling to insert a button into each row of MUI X DataGrid. Currently, I have an MUI X DataGrid component being rendered as follows: <DataGrid rows={rows} columns={columns} pageSize={5} checkboxSelection /> In the 'columns' variable, I& ...

Tips for displaying just the image name without the entire image file path

When I try to upload an image, the path displayed is "C:\fakepath\promotion1.JPG". This fake path is causing the image not to upload to my project media folder. How can I solve this issue? Instead of the complete path, I only want to capture the ...

Simple CSS3 Features for Seamless Browser Compatibility

Is there a more efficient way to add box-shadow to an HTML element? Currently, I have to include the following code: box-shadow: 2px 2px 3px #969696;<br> -moz-box-shadow: 2px 2px 3px #969696;<br> -webkit-box-shadow: 2px 2px 3px #969696; filte ...

``There seems to be an issue with CSS Transform/Transition not functioning properly

Here is some CSS code that I used to animate a list of items on my website: selector { display: flex; } #primary li a { -webkit-background-clip: text; -webkit-text-fill-color: transparent; ...

How can transitions be activated in Bootstrap 4 carousel?

Having an issue with my Bootstrap 4 carousel where I need to move 4 slides at a time. I have tried using the code below: $(this).carousel(4); However, the problem is that the carousel only jumps to that index without showing any transitions. Using $(this) ...

Is Firebase billing impacted by NextAuth integration?

Currently, I am utilizing NextAuth in conjunction with Firebase Auth as an adapter for authentication. This setup is particularly useful for authenticating my admin users exclusively on specific pages. My understanding is that NextAuth monitors the session ...

I'm looking to showcase both an image and text in the navbar-brand section of Bootstrap 4. How can

I have been attempting to place an image next to some text within my navbar-brand, but so far I have not been successful. Is there a way to achieve this without resorting to "hacking" bootstrap? Below is the code I have tried: <header> <nav ...

Issue encountered while attempting to implement custom fonts through CSS

When attempting to implement a custom font on my website using the CSS file, I am having trouble getting it to display correctly. Instead of seeing the desired font, only the default font is showing up. Can someone please review the CSS code below and le ...