我试图在屏幕宽度小于320px
时更改CSS。媒体查询没有响应
目前它卡在min-width
媒体查询中,并且在缩小我的屏幕时不会转到max-width
媒体查询。
我加入这个网站给我的索引页: <meta name="viewport" content="width=device-width">
这里是我的CSS的一部分:
div#imageColumn {
color:white;
background-color:black;
margin:10px;
}
div#contentColumn {
float:left;
color:white;
background-color: black;
margin:10px;
}
@media screen and (max-width:320px){
div#contentColumn {
width:75%;
}
div#imageColumn {
position: absolute;
bottom:0;
width:100%;
}
}
@media screen and (min-width:320px){
div#imageColumn {
float:right;
width:45%;
}
div#contentColumn {
width:25%;
}
}
我缺少的东西?
编辑:现在是中途工作。 @Media似乎是为某些属性开火,但不是为其他属性开火。文本在810处移动到屏幕的底部,但是h1对象的字体大小不变。
CSS: `
body {
font-family: 'Heebo', sans-serif;
background-color:black;
}
div#WmStephenScott {
font-family: 'Heebo', sans-serif;
color: white;
background-color: #C94B5B;
padding-top: 40px;
padding-bottom:40px;
padding-left:40px;
}
div#contactForm {
float:right;
padding-right: 100px;
}
h1#WmStephenScott {
padding-left:40px;
font-size:40px;
}
h3#contactMe {
float:right;
color:black;
padding-right:80px;
padding-top:200px;
font-size: 20px;
}
p {
color:white;
font-size:18px;
}
aside {
float:left;
background-color:'F0E4C9';
color: white;
padding-left:40px;
opacity:1;
width:20%;
}
div#imageColumn {
color:white;
background-color:black;
margin:10px;
}
div#contentColumn {
float:left;
color:white;
background-color: black;
margin:10px;
}
@media screen and (max-width:810x){
div#contentColumn {
width:50%;
}
div#imageColumn {
position: absolute;
bottom:0;
width:50%;
}
aside {
font-size:20px;
padding:5px;
}
h1#WmStephenScott {
font-size:20px;
padding-left:15px;
}
}
@media screen and (min-width:811px){
div#imageColumn {
float:right;
width:45%;
}
div#contentColumn {
width:25%;
}
}
div#feedbackFormDiv {
background-color:#C94B5B;
float:right;
padding-right:40px;
}
head {
}
}`
这里是我的HTML:
<!DOCTYPE html>
<html>
<head>
<title>Steve Scott</title>
<meta name="viewport" content="width=device-width">
<link href="https://fonts.googleapis.com/css?family=Heebo:400,800" rel="stylesheet">
<link href="{{url_for('static', filename='css/stylesheet.css')}}" rel='stylesheet' type='text/css'/>
<script type="text/javascript" src="{{url_for('static', filename='js/jquery-2.1.0.js')}}"></script>
<script type='text/javascript' src="{{url_for('static', filename='js/script.js')}}"></script>
</head>
<body>
<div id='WmStephenScott'>
<h3 id='contactMe'>Contact</h3>
<h1 id='WmStephenScott'>Wm. Stephen Scott</h1>
</div>
<aside>
<div id='aside'>
<br/>
<h2 id='AboutMe'>About Myself</h2>
<br/>
<h2 id='Code'>Code</h2>
<br/>
<h2 id='Geo'>Geo</h2>
<br/>
<h2 id='Design'>Design</h2>
<br/>
</div>
</aside>
<div id='contentColumn'>
</div>
<div id='imageColumn'>
</div>
<!--
<div id='feedbackFormDiv'>
<h2></h2>
</div>
-->
</footer>
</body>
<footer>
</html>
发表您的HTML代码 –
抱歉,是愚蠢的。 Ur代码没有什么理解。显示html,显示图片后和之前调整你的设计。 –
我现在有问题。一些CSS正在改变,但其中一些不是。这是CSS –