2016-02-07 20 views
0

确定两个问题......当屏幕变小时为什么我不能移动盒子?正如你可以从底部的代码看到的那样,滚动条仍然没有任何理由,即使填充,按钮也不会移动!我很感激你能建议的任何事情。@media屏幕?不能下移盒子?

<!DOCTYPE html> 
<html> 
<link rel="shortcut icon" href="https://upload.wikimedia.org/wikipedia/commons/thumb/5/5e/Metro-M.svg/2000px-Metro-M.svg.png"> 
<head> 
<style> 
body { 
    background: URL("https://lh3.googleusercontent.com/-lYQ3vQHE3Mo/VrVKGwg8pqI/AAAAAAAADMQ/QKjs5ALViKo/w530-d-h253-p-rw/desk%2Bbackground.png") white no-repeat center top; 
    background-size: 100%; 
    background-color: white; 
    margin: 0; 
    padding: 0; 
} 
h2 { 
Font-family: Arial; 
top: 650px; 
left: 10px; 
position: absolute; 
color: #525252; 
font-size: 2vw; 
letter-spacing: 1px; 

} 
h1 { 
    position: absolute; 
    top: 21%; 
    left: 36%; 
    color: white; 
    font-family: Arial; 
    font-size: 4.6vw; 
    letter-spacing: 1px; 
} 
p { 
    position: absolute; 
    width: 600px; 
    top: 800px; 
    left: 300px; 
    height: 25px; 
    font-family: Gill Sans, sans-serif; 
color:#696969; 
font-size: 17px; 
} 
ul { 
    word-spacing: .2em; 
    letter-spacing: .2em; 
} 
ul li { 
    font-family: Arial; 
    text-align: center; 
    vertical-align: middle; 
    line-height: 40px; 
    top: 43%; 
    display: inline-block; 
    margin-top: 250px; 
    margin-left: 115px; 
    letter-spacing: 1px; 
    word-spacing: normal; 
    background-color: rgba(5, 4, 2, 0.1); 
    border: 2px solid white; 
    color: white; 
    text-align: center; 
    text-decoration: none; 
    font-size: 90%; 
    width: 150px; 
    height: 40px; 
} 
ul li:link, 
ul li:visited { 
    font-family: Arial; 
    text-align: center; 
    vertical-align: middle; 
    line-height: 40px; 
    display: inline-block; 
    margin-top: 250px; 
    margin-left: 115px; 
    letter-spacing: 1px; 
    word-spacing: normal; 
    background-color: rgba(5, 4, 2, 0.1); 
    border: 2px solid white; 
    font-size: 90%; 
    width: 150px; 
    height: 40px; 
    text-decoration: none; 
    color: white; 
} 
li { 
    text-decoration: none; 
    color: white; 
} 
ul li:hover, 
ul li:active { 
    background-color: white; 
    color: black; 
    text-decoration: none; 
} 

ul li a:hover, ul li a:active { 
    background-color: white; 
    color: black; 
} 

ul li a { 
    display: inline-block; 
    height: 100%; 
    width: 100%; 
    color: white; 
    text-decoration: none; 
} 
hr { 
margin-right: 150px; 
margin-left: 150px; 
top: 700px; 

} 


@media screen and (max-width: 700px) { 

    .wrapper { 
    padding-top: 40%; 
    } 

    ul li { 
    margin: 10px; 

    } 
    h1{ 
    position:absolute; 
    top: 70px; 
    left: 180px; 
    font-size 
} 
} 
.wrapper { 
    padding-top: 0%; 
} 
</style> 
<link rel="stylesheet" type="text/css" href="about.css"> 
<title>morgan</title> 

</head> 
<body> 
<center><h1>WHO AM I?</h1></center> 
<h2>Some Fun Facts</h2> 

<p>I made this website from scratch when I was 14, I have a twin brother whose name is Pierson McNeal White, I have a older brother and sister who are aslo twins, I used to have 2 pet rats named Hermes and Cleo after the greek gods, and I watch the super bowl for the ads.</p> 
<div class="wrapper"> 
<ul> 
<li><a href="www.youtube.com" class="life" ><strong>MY LIFE</strong></a></li> 
<li><a href="www.youtube.com" class="prot"><strong>PORTFOLIO</strong></a></li> 
<li><a href="www.youtube.com" class="resume"><strong>RESUME</strong></a></li> 
<li><a href="about.html" class="me"><strong>ABOUT ME</strong></a></li> 
</ul> 
</div> 
</body> 
</html> 

回答

0

由于'p'元素的位置设置为绝对值,滚动条不会消失。以及300px的“左”值。

这意味着元素将停留在600px的宽度和300px的左侧值,即使窗口尺寸较小时也会有效地使其宽度为900px。

+0

哦,谢谢。这有助于很多 – Morgan

相关问题