【发布时间】:2021-12-25 05:45:42
【问题描述】:
我一直在尝试为我的 h1 标签创建响应式布局。当我不更改它的font-size 时,它工作得非常好,但是一旦我放大字体大小,文本就会在缩小窗口大小后与background-image 重叠。有没有办法解决这个问题?
这是我的代码:
body {
margin: 0;
padding: 0;
background-color: orangered;
}
.main-page-font {
background-image: linear-gradient(to left, blue, grey);
padding: 16em 10em;
background-size: cover;
}
.headers h1,
.headers h3 {
color: azure;
}
.headers h1 {
font-size: 8.5em;
}
<body>
<div class="main-page-font">
<div class="headers">
<h1>This is a long header for this page</h1>
<h3>Fit me within this space please</h3>
</div>
</div>
</body>
【问题讨论】:
标签: html css responsive-design responsive