Create a distinct CSS border radius

My goal is to create the pink section using border radius. However, when I apply border radius, it begins from the very edge of the container div, leaving about 1cm of flat or solid pink before the border radius starts.

Answer №1

It appears that those shapes are simply circles with the CSS property border-radius: 50%. Click "Run code snippet" to observe a similar effect in action.

.big {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: pink;
  position: relative;
}

.small {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: purple;
  position: absolute;
  top: 50%;
  left: 50%;
  box-shadow: rgba(0, 0, 0, 0.2) 3px 0 5px;
}
<div class="big">
  <div class="small">
  </div>
</div>

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

How to centrally position a menu item using Bootstrap

I'm having difficulty centering the logo and menu in the md and sm view. I would like to animate the margin of the brand logo and menu items, but using margin auto and position absolute is not working for me. Using TransformX and col-offset helps wi ...

Is there a way to locate button designs similar to Bootstrap's without actually relying on the

Looking to incorporate buttons with a similar style to those from Bootstrap into my web app. Does anyone have CSS styles available to achieve this look without relying on Bootstrap? Additionally, is there a collection of historical Bootstrap styles or te ...

Insufficient html content causing empty spaces on the page

Having trouble with my HTML layout - I want a main content area centered on the page with a sidebar that slides out from the left. Everything is working except for a large gap on the left side. How can I move my content to the left to fill the entire page ...

Is there a way for me to programmatically remove a user-inputted paragraph in JavaScript after a delay of 2 seconds

Recently, I mastered the art of creating a to-do list using JavaScript. As a fun personal project, I decided to implement this knowledge in creating a "Share Your Secret" website. The concept is simple: users can share their secrets anonymously on the plat ...

The art of organizing information: Tables and data management

Looking for a solution with a table: <table> <tr> <td>1</td> <td>2</td> <td>3</td> <td>4</td> </tr> </table> Trying to format the cells to display as: 1 2 3 4 ...

"Get a glimpse of the brackets image with real-time live

I seem to be encountering a strange issue. I have double-checked the source code for my image, and when I view the page in Chrome without using Brackets, the image displays properly. However, when I use Brackets Live preview, the image does not show up i ...

Clicking within the text activates the dropdown menu, but clicking outside the text does not

My custom drop down menu is not functioning properly. When I click on the text, it successfully links to another place, but when I click beside the text, it does not link. Can you please help me identify what's wrong here? Your assistance would be gre ...

Vue component always renders a new line

Whenever I include a <component> tag in my main application, it always renders on a new line. Is there a way to make it inline? I am trying to achieve something like this: <p>This is a component :<component></component></p> & ...

I'm puzzled as to why my fixed element is gravitating towards the right side of the entire screen instead of aligning with the right side of its parent element

I have inserted a code snippet that highlights my issue. I am attempting to ensure that the .navigation element remains fixed at the top of the colored divs, however, when using 'right: 0;', the .navigation element seems to shift to the right sid ...

The CSS Validator does not recognize the CSS pointer-events and appearance properties

I'm a CSS beginner who recently created an app. I've encountered some errors and warnings when validating my CSS code: https://i.stack.imgur.com/g4MUz.png https://i.stack.imgur.com/Es1DE.png Could someone kindly explain these errors and warnin ...

Expanding the width of a list-group with Bootstrap to fill the entire div

I am working with a div that has a height of 200px. How can I make sure the ul items are divided into equal rows within the div, instead of always aligning to the top? To illustrate this, I have colored the div green. As I will be using ngFor in my ul, the ...

Tips for ensuring smaller columns have the same height as their siblings

I'm facing an issue where I have a row with two columns dictating the height, but one of them is shorter than the others. How can I make the shorter column stretch to match the height of the row? This inconsistency in height is causing disruption to ...

The importance of having separate CSS styles for various browsers, particularly when dealing with different versions of Internet Explorer like IE6, IE7, IE8, and IE9

I have always been intrigued by the fact that default CSS does not always work across all browsers, often resulting in breaks specifically for IE browsers (6, 7, 8, 9). As a result, we typically find ourselves creating multiple CSS files tailored for dif ...

Learn a simple method of integrating carousels into text elements within a grid using exclusively Bootstrap 5

I need to incorporate a carousel into this section of my code using only Bootstrap 5. However, the current implementation is not functioning as expected (the items are stationary): This is the relevant HTML snippet: <div class="container px-4" ...

What is the purpose of a single-row border with a top and bottom border that

Just to let you know, I'm new here so please be patient with me ;) I'm having an issue styling my foreach loop. My goal is to have a single line border appear at the top and bottom of each row when hovered over. However, the problem is that when ...

Content in Slider Exceeding Container Bounds

After successfully creating a slider using jQuery with the help of some Stack Overflow users, everything was working perfectly. However, when attempting to change the layout of the slider, it somehow broke and now all slides are being pushed out of the con ...

Is there a problem with using p:first-child when there is an img tag right after the p tag?

Greetings, I am having trouble getting this to work properly: .body-post p:first-child:first-letter { font-size:240%; } and here is the HTML code: <div class="body-post"> <p><img src="http://#" align="left" style=" ...

Swapping out a background video for a background image in cases where auto-play is restricted on the device

How can I replace an auto-play background image with a static image on devices that do not support auto-play? The <video> tag's POSTER attribute works, but it seems that on my iPhone (which does not allow auto-play), the video is still downloade ...

My goal is to overlay an information box on top of an image while ensuring that both elements remain contained within the designated area

I've experimented with different approaches, such as using position absolute on one element and position relative on the other. However, I always face issues where one overflows, despite setting overflow to hidden. Below is my current code snippet. (P ...

Verify if the entire block contains any children with text inside

When working with Selenium WebDriver, I encountered an issue trying to locate a block that contains children elements with specific inner text. <div class="chat_dialog"> <div class="chat_message"> <span class="chat_timestamp" style="disp ...