Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vertically center dots with CSS

Tags:

html

css

unicode

How can I make dots between links vertically centered with only CSS? It's possible but I can't figure out how to do it.

Expected:

Facebook inline list: Unlike, Comment, Share, 1413, 70, 76, about a minute ago

HTML

<label><a href="#">Like</a></label> <label><a href="#">Comment</a></label> <label><a href="#">Share</a></label> <label><span>1 hour ago</span></label>​ 

CSS

a{      vertical-align: middle; }  label:not(:last-child):after{     content: " . "; } 

Not working example: http://jsfiddle.net/4ZFMm/

Thanks!

like image 524
Luccas Avatar asked Oct 25 '12 03:10

Luccas


People also ask

How do I make 3 vertical dots in CSS?

Unicode includes ⠇ which is the Braille symbol for the letter "U". To use, just use the HTML entity &#10247; in your code.

How do I make a vertical dotted line in CSS?

There are many ways to create a vertical dotted line in CSS, but the most common and simplest method is to use the border-left property. To create a vertical dotted line, all you need to do is set the border-left property to have a dotted line.

How do you add a dot in center?

Make the middle dot / median dot (·) on Windows : The technique : Keep the Alt key pressed (key just to the left of the Space bar), then you successively type the numbers 0 1 8 3 then you finally release the Alt key, which will bring up the middle dot / median dot at desired location.


2 Answers

Use &middot; · for a dot or &bull; for a thicker, bulleted list style dot.

For use in the content attribute, you'll need to escape it:

middot:

content: " \B7 "; 

bull:

content: " \2219 "; 

Refrences:

  • Adding HTML entities using CSS content
  • 24.2.1 The list of characters - Character entity references in HTML 4
like image 149
sachleen Avatar answered Sep 18 '22 08:09

sachleen


Somehow these got screwed up on the live server, although they worked locally, here's what worked for me, maybe it'll help someone else:

.element:before {     content: "\2022"; } 
like image 26
Jonas Grumann Avatar answered Sep 18 '22 08:09

Jonas Grumann