Vertically centering text in a div

0 votes

I'm trying to vertically center the text inside the 4 divs with sat, bit, mBTC, and BTC in them. I tried doing

display:table-cell;
vertical-align:middle;

But it does not work. Any idea how I can do this?

Sep 3, 2018 in Blockchain by slayer
• 29,350 points
595 views

1 answer to this question.

0 votes

Try this code:

.smallUnitBox {
    background-color: #29b8ff;
    border-right: 2px solid #2098d4;
    float: left;
    height: 36px;
    width: 96px;
    line-height: 36px;
    color: white;
    font-size: 28px;
    font-family: sans-serif;
    border-bottom: 1px solid #2098d4;
}

<div class="unitBox">
  <div class="smallUnitBox">sat</div>
  <div class="smallUnitBox">bit</div>
  <div class="smallUnitBox">mBTC</div>
  <div class="smallUnitBox">BTC</div>
</div>

Don't forget to remove as it's not needed:

display:table-cell;
vertical-align:middle;
answered Sep 3, 2018 by digger
• 26,740 points

Related Questions In Blockchain

0 votes
1 answer

How to make sure transactions take no fee in a private Ethereum blockchain?

In a private ethereum network you have ...READ MORE

answered Mar 26, 2018 in Blockchain by Christine
• 15,790 points

edited Mar 26, 2018 by Christine 1,367 views
+4 votes
2 answers

How do I create a new block in Hyperledger Fabric?

This link might help you: https://github.com/hyperledger/fabric-sample ...READ MORE

answered Oct 11, 2018 in Blockchain by Sahu
2,360 views
+1 vote
1 answer

Protocols used in a distributed/dlt system for the nodes to establish communication

yes all are over TCP/IP connections secured ...READ MORE

answered Aug 6, 2018 in Blockchain by aryya
• 7,450 points
1,151 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
1,709 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,241 views
0 votes
1 answer

How can I take the required info and send it to a div in the html page?

window.onload=function(){ var anima = document.getElementById("crypto"); var ret = document.getElementById("btn"); ret.addEventListener("click",function(){ var ...READ MORE

answered Sep 6, 2018 in Blockchain by digger
• 26,740 points
569 views
0 votes
1 answer

How to create a Genesis Block in a Private Network?

{     "nonce": "0x0000000000000042",     "difficulty": "0x000000100",     "alloc": {     },     "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",     "coinbase": "0x0000000000000000000000000000000000000000",     "timestamp": "0x00",     "parentHash": ...READ MORE

answered Jul 12, 2018 in Blockchain by digger
• 26,740 points
1,819 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP