Higeath
Higeath

Reputation: 3

Why is min-height not working on my table in Safari and Firefox?

The site works properly on Chrome and Edge, but is squished on Firefox and Safari.

Here is a working JSFiddle

Here is a picture showing comparison between top - Safari and bottom - Chrome. It is supposed to look like the bottom one. http://imgur.com/7fmjEG5.

.spell span {
    position: relative;
    top: 25%;
}
.note {
    clear: both;
}
.spell {
    text-align: center;
    max-width: 100%;
    height: 35px;
    background-color: #E7E7E7;
}
.BUFF {
    background-color: #80DE57;
}
.NERF {
    background-color: #DE5B54;
}
.CHANGE {
    background-color: #D2A557;
}
.NEW {
    background-color: #50B9EB;
}
.BUGFIX {
    background-color: rgb(141, 141, 141);
}
.change_icon {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    cursor: default;
    color: white;
    vertical-align: middle;
    text-align: center;
    min-width: 70px;
    height: 100%;
    display: table-cell;
}
<div class="note">
    <div class="spell"> <span class="spelliconwithtitle">text</span>

    </div>
    <hr style="margin: 0; padding: 0;">
    <div style="overflow: auto;width: 100%; min-height: 41px; max-height: 100%; position: relative; display: table; ">
        <p style="padding: 0px 5px 0px 5px;width: 100%;margin: 0 1% 0 1%;display: table-cell; ">test</p>
        <div class="change_icon BUFF">text</div>
    </div>
    <hr style="margin: 0; padding: 0;">
    <div style="overflow: auto;width: 100%; min-height: 41px; max-height: 100%; position: relative; display: table; ">
        <p style="padding: 0px 5px 0px 5px;width: 100%;margin: 0 1% 0 1%;display: table-cell; ">test</p>
        <div class="change_icon NERF">nerf</div>
    </div>
</div>

Upvotes: 0

Views: 2163

Answers (2)

Aaron
Aaron

Reputation: 10450

min-height doesn't work on tables.

You will have to replace it with height

.spell span {
    position: relative;
    top: 25%;
}
.note {
    clear: both;
}
.spell {
    text-align: center;
    max-width: 100%;
    height: 35px;
    background-color: #E7E7E7;
}
.BUFF {
    background-color: #80DE57;
}
.NERF {
    background-color: #DE5B54;
}
.CHANGE {
    background-color: #D2A557;
}
.NEW {
    background-color: #50B9EB;
}
.BUGFIX {
    background-color: rgb(141, 141, 141);
}
.change_icon {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    cursor: default;
    color: white;
    vertical-align: middle;
    text-align: center;
    min-width: 70px;
    height: 100%;
    display: table-cell;
}
<div class="note">
    <div class="spell"> <span class="spelliconwithtitle">text</span>

    </div>
    <hr style="margin: 0; padding: 0;">
    <div style="overflow: auto;width: 100%; height: 41px; max-height: 100%; position: relative; display: table; ">
        <p style="padding: 0px 5px 0px 5px;width: 100%;margin: 0 1% 0 1%;display: table-cell;height: 41px; ">test</p>
        <div class="change_icon BUFF">text</div>
    </div>
    <hr style="margin: 0; padding: 0;">
    <div style="overflow: auto;width: 100%; height: 41px; max-height: 100%; position: relative; display: table; ">
        <p style="padding: 0px 5px 0px 5px;width: 100%;margin: 0 1% 0 1%;display: table-cell; height: 41px;">test</p>
        <div class="change_icon NERF">nerf</div>
    </div>
</div>

Upvotes: 2

Joel Almeida
Joel Almeida

Reputation: 8047

For diversity:

Instead of height you can use line-height on the elements.

.spell span {
    position: relative;
    top: 25%;
}
.note {
    clear: both;
}
.spell {
    text-align: center;
    max-width: 100%;
    height: 35px;
    background-color: #E7E7E7;
}
.BUFF {
    background-color: #80DE57;
}
.NERF {
    background-color: #DE5B54;
}
.CHANGE {
    background-color: #D2A557;
}
.NEW {
    background-color: #50B9EB;
}
.BUGFIX {
    background-color: rgb(141, 141, 141);
}
.change_icon {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    cursor: default;
    color: white;
    vertical-align: middle;
    text-align: center;
    min-width: 70px;
    height: 100%;
    display: table-cell;
}
<div class="note">
    <div class="spell"> <span class="spelliconwithtitle">text</span>

    </div>
    <hr style="margin: 0; padding: 0;">
    <div style="overflow: auto;width: 100%; min-height: 41px; max-height: 100%; position: relative; display: table; ">
        <p style="padding: 0px 5px 0px 5px;width: 100%;margin: 0 1% 0 1%;display: table-cell; line-height: 41px; ">test</p>
        <div class="change_icon BUFF">text</div>
    </div>
    <hr style="margin: 0; padding: 0;">
    <div style="overflow: auto;width: 100%; min-height: 41px; max-height: 100%; position: relative; display: table; ">
        <p style="padding: 0px 5px 0px 5px;width: 100%;margin: 0 1% 0 1%;display: table-cell; line-height: 41px; ">test</p>
        <div class="change_icon NERF">nerf</div>
    </div>
</div>

Upvotes: 0

Related Questions