Thursday, October 5, 2017

In the table-cell approach in CSS the padding comes out of the width in lieu of adding to it.

How wide will this be? 135 pixels? Wrong! It will be 130 pixels wide.

.floatLeft {
   float:left;
   width: 130px;
   height: 25px;
   background-color:blue;
   display: table-cell;
   text-align: right;
   padding-right: 5px;
}

 
 

This is at least true (the reality) in Google Chrome.

No comments:

Post a Comment