0
請刪除 - 這是一個錯字:)內聯CSS會產生不同的結果,那麼等效CSS類
下面的CSS
display: table; height: 100%;
工作在在線模式很好,不工作被提取成CSS類。我如何解決它?
帶內嵌CSS(工作版本)的HTML,重現問題搜索首次出現的「display:table; height:100%;」然後創建一個類.blah {display:table;身高:100%; } 並嘗試使用它而不是內聯CSS。
<html>
<head>
<title></title>
</head>
<body>
<div style="margin: 100px; width: 100px; height: 430px; background-color: gray; border: 1px solid gray;">
<table style='background-color: white; width: 100%; height: 100%; border-collapse: collapse; vertical-align: top;'>
<tr>
<td style='height: 33.33%;'>
<div style="position: relative; width: 100%; height: 100%;">
<div style="position: absolute; top: -50%; height: 100%; background-color: green;">
<div style="display: table; height: 100%;">
<div style="display: table-cell; vertical-align: middle;">
<div style="border: 1px solid #ccc; width: 30px; height: 30px; background-color: yellow;">A</div>
</div>
</div>
</div>
<div style="position: absolute; bottom: -50%; height: 100%;">
<div style="display: table; height: 100%;">
<div style="display: table-cell; vertical-align: middle;">
<div style="border: 1px solid #ccc; width: 30px; height: 30px; background-color: yellow;">B</div>
</div>
</div>
</div>
</div>
</td>
</tr>
<tr>
<td style="height: 33.33%;">
<div style="position: relative; width: 100%; height: 100%;">
<div style="position: absolute; bottom: -50%; height: 100%;">
<div style="display: table; height: 100%;">
<div style="display: table-cell; vertical-align: middle;">
<div style="border: 1px solid #ccc; width: 30px; height: 30px; background-color: yellow;">C</div>
</div>
</div>
</div>
</div>
</td>
</tr>
<tr>
<td style="height: 33.33%;">
<div style="position: relative; width: 100%; height: 100%;">
<div style="position: absolute; bottom: -50%; height: 100%; display: table-cell; vertical-align: middle;">
<div style="display: table; height: 100%;">
<div style="display: table-cell; vertical-align: middle;">
<div style="border: 1px solid #ccc; width: 30px; height: 30px; background-color: yellow;">D</div>
</div>
</div>
</div>
</div>
</td>
</tr>
</table>
</div>
</body>
</html>