Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vertically align smaller bullets with larger text

I have a list with bullets. I made the bullets smaller by putting the li text inside a span and making the font-size of the li smaller than that of the span. The problem is that now the bullets are not vertically aligned in relation to the text. How do I fix that?

jsFiddle: http://jsfiddle.net/tXzcA/

li {
  font-size: 15px;
}

li span {
  font-size: 25px;
}
<ul>
  <li><span>text1</span></li>
  <li><span>text2</span></li>
  <li><span>text3</span></li>
  <li><span>text4</span></li>
</ul>
like image 928
dmr Avatar asked Jan 15 '13 16:01

dmr


People also ask

How do you vertically align bullet points in Word?

Select the “Layout” tab and then click the arrow next to “Vertical Alignment” in the “Page” section. A selection of vertical alignment options will appear. Go ahead and click “Center” (or choose another option that better suits your requirements). Your text will now reflect the selected vertical alignment option.

How do you align text vertically?

Center the text vertically between the top and bottom margins. Select the text that you want to center. in the Page Setup group, and then click the Layout tab. In the Vertical alignment box, click Center.


2 Answers

You could just make your own bullet point and make it whatever size you want.

li{   font-size: 15px;   list-style-type:none;  } li span{   font-size: 25px; }  ul li:before {    content: "•";    font-size: 80%;    padding-right: 10px; } 

Just change around the font-size to the size you want.

jsFiddle

like image 183
Jason Avatar answered Oct 19 '22 08:10

Jason


Try this:

li span{
  font-size: 25px;
  vertical-align:middle;
  padding-bottom:5px;
}

See it here: http://jsfiddle.net/tXzcA/19/

like image 29
Brian Salta Avatar answered Oct 19 '22 07:10

Brian Salta