【发布时间】:2020-03-06 00:53:50
【问题描述】:
我的网站将提供有关温度的信息,我希望读取温度,然后显示度数符号和“C”或“F”。页面上还有其他关于天气的信息,所以我使用 CSS 网格来布局页面并将所有部分分解。当我将度数注释字体变小时,度数在页面上移动得更高。我希望它与温度值一致,但我无法弄清楚页面中发生了什么。任何帮助都会很棒。
有问题的文字的照片:
.wrapper {
display: grid;
grid-template-rows: 200px 100px;
padding-bottom: 2.5em;
}
.temp {
display: grid;
grid-template-columns: 150px 150px;
padding: none;
font-size: 3em;
align-content: center;
justify-content: center;
}
.degree-note {
font-size: 30px;
align-content: center;
}
<div class="wrapper">
<img class='loading-text' src='img/weather-app-loading.png'>
<div class='temp'>
<h2 class='temp-degree'>34</h2>
<h2 class='degree-note'>° C</h2>
</div>
</div>
【问题讨论】:
标签: html css frontend css-grid