Text overflowing from html button seems to be in contrast to applied style
I just can't figure out why the text of this button doesn't wrap to the next line. Instead, it ends at the end. Here's the style:
#find-attach-all-content-container input[type="button"] {
width: 60px;
height: 60px;
background-color: #fd902a;
color: #fff;
padding: 5px;
position: absolute;
left: -10px;
top: -20px;
font-size: 14px;
line-height: 15px;
overflow: visible;
text-align: center;
border: solid #b6b6b6 1px;
}
Here is the html:
<input type="button" class="attach-btn" value="Attach to Response" onclick="postConditionFindCure( <?php echo get_the_ID() ?> );">
source to share
overflow: visible
will work with text only if the container element has no static one height
.
Also, you will need to overwrite the default white-space
by setting it to normal
, otherwise the text will be wrapped at the end of its container element.
So, you will need to change your styles by removing height
and installing white-space
:
#find-attach-all-content-container input[type="button"] {
width: 60px;
/* height: 60px; */
background-color: #fd902a;
color: #fff;
padding: 5px;
position: absolute;
left: -10px;
top: -20px;
font-size: 14px;
line-height: 15px;
overflow: visible;
text-align: center;
border: solid #b6b6b6 1px;
/* Added */
white-space: normal;
}
source to share