Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to move an element down a litte bit in html

Tags:

html

css

That sounds weird I know, but I am having trouble getting a piece of text to move down a tiny bit so it's centered on the tab it's on.

here's what it looks like:

enter image description here

I want buy to be centered vertically.

Here is the html:

<div class="row-2">
     <ul>
         <li><a href="index.html" class="active">Buy</a></li>
     </ul>
</div>
like image 619
novicePrgrmr Avatar asked Apr 07 '11 20:04

novicePrgrmr


2 Answers

You can set the line height on the text, for example within the active class:

.active {
    ...
    line-height: 2em;
    ....
}
like image 70
My Head Hurts Avatar answered Sep 28 '22 15:09

My Head Hurts


<div class="row-2">
 <ul>
     <li><a href="index.html" class="active"><p style="margin-top: 10px;">Buy</p></a></li>
 </ul>

Play with it

like image 32
poseso Avatar answered Sep 28 '22 17:09

poseso