jquery - @媒体屏幕?不能向下移动框?

标签 jquery html css

好吧,两个问题...当屏幕变小时,我如何去掉滚动条,为什么我不能向下移动框?正如您从底部的代码中看到的那样,滚动条仍然无缘无故地存在,即使有填充,按钮也不会移动!我很感激你能提出的任何建议。

<!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>

最佳答案

滚动条没有消失,因为“p”元素的位置设置为绝对。以及 300 像素的“左”值。

这意味着该元素将保持 600 像素的宽度和 300 像素的左值,即使窗口尺寸较小,也能有效地使其达到 900 像素的宽度。

关于jquery - @媒体屏幕?不能向下移动框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35255096/

相关文章:

java - 无法从jsf页面将数据表导出到excel

css - seo和div显示:none

jquery - 我正在尝试访问一个类(class),但我无法访问

javascript - 对话框中的长度错误

Javascript - 如何检查表单上的 2 个条件

javascript - 使用 jQuery 偏移来定位 <div>,但看起来位置增加了

html - 如何使 div float 在分栏文本上

javascript - 非常风格的 CSS 巨型菜单

html - 每一个下的div

jquery - 记住页面刷新之间的 jQuery 可拖动工具选项板位置