How can I make a dot under text using only CSS as shown in below picture?
The picture needs to be always in middle with any length of string.
Probably I need to use :before
OR :after
? I've tried but result was awful.
The Unicode and HTML Entities for Bullet Points The Unicode character for showing the dot symbol or bullet point is U+2022 . But to use this Unicode correctly, remove the U+ and replace it with ampersand ( & ), pound sign ( # ), and x . Then type the 2022 number in, and then add a semi-colon.
First, you need to display it inline-block. This allows you to manipulate its size. Then, you need to give him the same height, same width to make it square. After that, you will make a border radius of 50% so that it becomes round.
A transformed pseudo element can be used to create this:
body { text-align: center; }
.text {
display: inline-block;
vertical-align: top;
padding-bottom: 10px;
position: relative;
text-align: center;
padding: 20px 10px;
line-height: 24px;
min-width: 100px;
background: #333;
font-size: 20px;
color: #fff;
}
.text::before {
transform: translateX(-50%);
border-radius: 100%;
position: absolute;
background: blue;
bottom: 10px;
height: 8px;
content: '';
width: 8px;
left: 50%;
}
<div class="text">about</div>
.char {
display: inline-block;
position: relative;
}
.char::before {
content: '.';
display: inline-block;
position: absolute;
bottom: -0.5em;
left: 0;
text-align: center;
width: 100%;
}
After writing this question on stack i come up with idea:) Its works excatly like I want :)
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