How to center the Text Test Text
vertically? see here
I want to make distance between the text and the boarder bottom equals the distance between the text and the boarder top. `
How to center the Text Test Text
vertically? see here
I want to make distance between the text and the boarder bottom equals the distance between the text and the boarder top. `
For single lined text, use line-height
that is equal to height
(or rounded up to even number).
#a {
display: inline-block;
padding-right: 20px;
padding-left: 15px;
font-family: 'Roboto';
font-size: 12px;
font-weight: bold;
font-stretch: condensed;
COLOR: white;
border-left: 10px solid transparent;
border-bottom: 25px solid;
border-bottom-color: #FF3300;
height: 0;
line-height: 26px;
top: 50%;
}
<span id="a">TEST TEXT</span>
Use line-height: 25px
(will work for single-line text only).
#a {
display: inline-block;
padding-right: 20px;
padding-left: 15px;
font-family: 'Roboto';
font-size: 12px;
line-height: 25px;
font-weight: bold;
font-stretch: condensed;
COLOR: white;
border-left: 10px solid transparent;
border-bottom: 25px solid;
border-bottom-color: #FF3300;
height: 0;
top: 50%;
}
<span id="a">TEST TEXT</span>
Use :before
pseudo element for left part, line height is not going to work with bottom-border
. I updated your fiddle:
.area {
width: 300px;
height: 300px;
position: relative;
}
.bubble {
position: absolute;
left: 93px;
top: 21px;
width: 135px;
height: 84px;
display: table;
}
.bubble p {
display: table-cell;
vertical-align: middle;
text-align: center;
<div class="area">
<div class="bubble">
<p>To look best, text should really be centered inside this bubble both vertically and horizontally.</p>
</div>
</div>