Html 媒体查询不起作用。
我试图在手机上加大我的页脚img(社交媒体图标)的宽度。但是当我在媒体查询中更改宽度时,什么也没有发生。我用“footer img”更改了原始css中的宽度,效果很好。然后我想我意识到我的媒体查询都不起作用。为什么我的媒体查询没有生效Html 媒体查询不起作用。,html,css,Html,Css,我试图在手机上加大我的页脚img(社交媒体图标)的宽度。但是当我在媒体查询中更改宽度时,什么也没有发生。我用“footer img”更改了原始css中的宽度,效果很好。然后我想我意识到我的媒体查询都不起作用。为什么我的媒体查询没有生效 ORIGINAL CSS footer img { width: 40px; } a { color: white; text-decoration: none; } a:hover { color: #0077C0; } h1 { t
ORIGINAL CSS
footer img {
width: 40px;
}
a {
color: white;
text-decoration: none;
}
a:hover {
color: #0077C0;
}
h1 {
text-align: center;
margin-top: 25px;
}
h4 {
margin: 0px 125px 0px 125px;
}
.alignleft {
float: left;
margin-left: 15px;
}
.alignright {
float: right;
margin-right: 15px;
height: 30%;
}
MEDIA QUERIES {
/*iPhone 6/7/8 and iPad*/
@media (max-width: 450px) {
#index {
background-position: 41% 59%;
}
.grid-container {
height: 100vh;
}
.grid-item {
font-size: 25px;
}
.name {
font-size: 32px;
}
.grid-item img {
max-height: 70%;
width: 100%;
}
.WhiteHouse img {
max-height: 55%;
}
.alignleft {
float: none;
text-align: center;
}
.alignright {
float: none;
text-align: center;
margin-left: 7%;
}
#GitHub {
width: 25%;
}
footer img {
width: 50%;
}
}
不要在媒体查询{}中包装媒体查询 也可以试着把它放在html页面的head标签中
<meta name="viewport" content="width=device-width, initial-scale=1">
不要在媒体查询{}中包装媒体查询 也可以试着把它放在html页面的head标签中
<meta name="viewport" content="width=device-width, initial-scale=1">
你在哪里用最大宽度450px
?@ZombieChowder在@media(最大宽度:450px)
检查它?在编解码器中,您可以创建一个简化的示例来显示这一点吗?现在看来,它应该可以工作了,你需要提供一个。您提供的代码既不是最小的,也不是完整的。您在哪里使用最大宽度450px
检查它?@ZombieChowder at@media(最大宽度:450px)
?在编解码器中,您可以创建一个简化的示例来显示这一点吗?现在看来,它应该可以工作了,你需要提供一个。您提供的代码似乎既不最少,也不完整。