Reputation: 3496
I have the following ul
, which produces a square bullet that (without modification) is very slightly larger than the default square bullets in HTML.
li:before {
content: "\25a0";
margin-right: 6px;
color: blue;
}
Problems:
Any clues on how to fix this?
Upvotes: 14
Views: 38262
Reputation: 54212
You need to add the below CSS properties to li:before
font-size: 128px;
vertical-align: middle;
You can change the 128px
to any size you want.
Upvotes: 28
Reputation: 4618
Please note that at least your fiddle behaves totally different across browsers !
You did not specify a font-family for the Unicode part. In the fiddle many Unicode characters will appear larger in Firefox, IE and Edge. Probably in all non-webkit browsers.
Add e.g.
font-family: "Lucida Sans Unicode", "Arial Unicode MS";
everywhere you want to use Unicode characters crossbrowser ...
You can read more about the differences in detail here: https://www.smashingmagazine.com/2014/05/unicode-for-a-multi-device-world/
Upvotes: 5
Reputation: 473
Add font-size:12em;
to your CSS. Since you're using a unicode character it's technically part of a font; because of this, you can use font-size
to change the size of the bullet. Also, as Raptor pointed out, use vertical-align: middle
to line up the text as before
Upvotes: 3