gpt4 book ai didi

html - CSS 媒体查询不覆盖

转载 作者:行者123 更新时间:2023-12-05 09:37:21 31 4
gpt4 key购买 nike

我无法安静地解决这个问题。我对 html 和 css 还是很陌生,但之前使用过媒体查询,但这次虽然它适用于一个元素(子标题),但它不适用于另一个元素(标题)。

/* =============Standards for Texts============== */
.sub-header {
font-size: 1.3rem;
font-weight: 200;
color: hsl(229, 6%, 66%);
margin-top: 6ch;
}

.header {
font-size: 1.3rem;
font-weight: 600;
color: hsl(234, 12%, 34%);
}

.description {
font-size: 1rem;
font-weight: 400;
color: hsl(229, 6%, 66%);
}

body > .sub-header, header {
font-size: 1.5rem;
}

/* ===============Port to Desktop=============== */
@media (min-width: 800px) {
html, body {
width: 100%;
height: 100%;
}


body > .sub-header, header {
font-size: 3rem;
color: red;
}

enter image description here

最佳答案

您在 CSS 中的 header 之前缺少一个句点。

/* This targets a <header> tag */
header { }

/* This targets any element with a class named header */
.header { }

关于html - CSS 媒体查询不覆盖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64292496/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com