I'm trying to use CSS and HTML to create a text underline that's curved. The curve in particular has been referred to as a "swoosh" in the design brief I was given, it needs to fall short of the first and last letter (i.e. to underline "help you", it would start at "e" and end at "o" - this part I figure is easy, applying the style to a span tag without the first and last letter), and has to have rounded ends. The swoosh is also not even.
Here's an example:
I'm not super crash hot with CSS, but I know I'm constrained to CSS and HTML in this case - no HTML5 or using javascript to get it done.
So far, I've only managed to come up with this:
.swoosh1 {
width: 500px;
height: 100px;
border: solid 5px #cb1829;
border-color: #cb1829 transparent transparent transparent;
border-radius: 50%/100px 100px 0 0;
}
Which looks like this (don't worry about the font): :(
Does anyone have any pointers? Done it before?
Windows MacOS Web You can use WordArt with a Transform text effect to curve or bend text around a shape. If you want the text to circle the shape, you can also do this, but it’s a little bit more work. You can also insert WordArt multiple times to wrap text around shapes with straight edges.
We’ll show you several ways to use underline in Word. Many people reserve underlining for web links while others find it a good way to emphasize text in a document. Along with the options for underlining words and spaces, you can format it as a double, bold, or dotted line and remove an underline you’ve added. Let’s walk through it all!
Curving Words in Word. Select the Insert tab, located towards the upper left-hand corner of the main Word interface. Select Insert WordArt, found within the Text section in Word 2016 for Windows and represented by a slanted blue letter A. In Word for macOS, as well as in earlier Windows versions, this button also contains...
Yes, you can add curved text to photo online for free! MockoFun is not just a circle logo design maker or a logo maker with curved text. Use it to add text around circle shapes like this pizza for example.
You can use :after
pseudo-element to hold your underline:
.underlined {
position: relative;
margin-right: 1rem;
}
.underlined:after {
content: "";
position: absolute;
bottom: -10px;
left: 0;
height: 7px;
width: 100%;
border: solid 2px #cb1829;
border-color: #cb1829 transparent transparent transparent;
border-radius: 50%;
}
.small {
font-size: 60%;
}
.big {
font-size: 200%;
}
<span class="underlined">Test</span>
<span class="underlined small">Test</span>
<span class="underlined big">Test</span>
Use :after
and then use border
and radius
and position
it
Learn about pseudo:https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements
.text:after{
content: "";
position: absolute;
height: 15px;
width: 70px;
left: 5px;
top: 37px;
border-top: 2px solid red;
border-radius: 50%;
}
.text{
font-family: "Comic Sans MS", cursive, sans-serif;
color:red;
}
<p class="text">Your local</p>
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