Derek 朕會功夫 Derek 朕會功夫 - 1 year ago 79
CSS Question

How to push up text in CSS?


I am trying to push up the text in a

by 50%, and I tried

padding-bottom: 50px; /*div is 100px high*/

But it does not work.

padding-top: -50px;

This does not work too. Any work-around?

Answer Source

line-height:0px; pushes it up some, but I don't know how much and it's apparently not 50px as you want.

You can wrap the element in another container and position it like so:


<div class="container">
  <div class="block">龍</div>

CSS (only showing modifications from your style)

    position: relative;
.block {
  position: absolute;
  top: -50px;


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download