I'm trying to make my border bottom look like this:
With one curved end. Currently it looks like this:
The CSS I'm trying to use is border-bottom-right-radius: 10px;
. The code looks like this:
<div class="title">
lorem ipsum
</div>
.title {
border-bottom: 10px solid $mainRed;
border-bottom-right-radius: 10px;
}
I also tried border-radius: 10px;
which gives me the same result except both ends are curved. Increasing this number just makes the line slope upwards. How can I make the line look correct?
CSS Syntaxborder-bottom-left-radius: length|% [length|%]|initial|inherit; Note: If you set two values, the first one is for the bottom border, and the second one for the left border. If the second value is omitted, it is copied from the first. If either length is zero, the corner is square, not rounded.
The border-bottom-left-radius CSS property rounds the bottom-left corner of an element by specifying the radius (or the radius of the semi-major and semi-minor axes) of the ellipse defining the curvature of the corner.
The border-end-end-radius CSS property defines a logical border radius on an element, which maps to a physical border radius that depends on the element's writing-mode , direction , and text-orientation . This is useful when building styles to work regardless of the text orientation and writing mode.
The border-radius CSS property rounds the corners of an element's outer border edge.
This is not possible within default borders, as border-radius
controls the radius around the element, not a single border edge.
I would recommend faking it with a pseudo-element:
div {
max-width:50vw;
padding-bottom:25px;
position:relative;
}
div:after {
content:'';
position:absolute;
bottom:0;
left:0;
right:0;
background:red;
height:20px;
border-radius:0 10px 10px 0;
}
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quippe: habes enim a rhetoribus; Quodsi ipsam honestatem undique pertectam atque absolutam. Duo Reges: constructio interrete. Urgent tamen et nihil remittunt.</div>
I dont know if this is the best solution, but there it go:
<style>
.title .underline {
border-top: 10px solid red;
border-top-right-radius: 10px;
border-bottom: 10px solid red;
border-bottom-right-radius: 10px;
}
</style>
<div class="title">
lorem ipsum
<div class="underline"></div>
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With