gpt4 book ai didi

javascript - HTML,CSS,JQuery 网页正文垂直拉伸(stretch)过多

转载 作者:行者123 更新时间:2023-11-30 12:09:02 31 4
gpt4 key购买 nike

所以我几乎完成了我的元素,我打算创建一个完整的网页 slider 作为我网站的背景主题,并且它运行完美!

问题是它的垂直拉伸(stretch)太长,您可以向右滚动(您不应该那样做)而且我不知道为什么它现在会这样。我一直在尝试用 JavaScript 修复它,但它没有做任何事情,所以我在这里寻找一些答案。我想要完成的是在水平方向(它已经固定)和垂直方向(我似乎无法开始工作)都有一个固定大小的网页。它似乎在 fiddle 上工作得很好(我是 fiddle 的新手)

这是我的 fiddle 和源代码。

https://jsfiddle.net/z8vqp7fe/1/

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Full Width Responsive Image Slider</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://malsup.github.com/jquery.cycle2.js"></script>
<style type="text/css">
html,body,img {padding: 0; margin: 0;height:100%;width:100%}
body {font-family: Sans-Serif;}

.container{

height:100%;
width:100%;
overflow: hidden;

}

.cycle-slideshow {
height: 100%;
width: 100%;
display: block;
position: relative;
margin: 0 auto;

}
.cycle-prev, .cycle-next {
font-size: 200;
color: #FFF;
display: block;
position: absolute;
top: 50%;
margin-top: -16px;
z-index: 9999;
cursor: pointer;

}

.cycle-prev {left: 10%;}
.cycle-next{right: 10%;}


.cycle-pager{
width: 100%;
text-align: center;
display: block;
position: absolute;
position: top;
bottom: 20px;
z-index: 9999;
}

.cycle-pager span {
text-indent: 100%;
white-space: nowrap;;
width: 12px;
height: 12px;
display: inline-block;
border: 1px solid #FFF;
border-radius: 50%;
margin: 0 10px;
cursor: pointer;

}
.cycle-pager .cycle-pager-active {background: #FFF;}

</style>
</head>



<body>


<!-- Full Width Responsive Slider -->

<div class="cycle-slideshow">
<span class="cycle-prev">&#9001;</span>
<span class="cycle-next">&#9002;</span>
<span class="cycle-pager"></span>
<img src="images/Untitled.png">
<img src="images/wp.png">
<img src="images/wp2.png">
</div>

<!-- Full Width Responsive Slider -->



</body>
</html>

最佳答案

试试这个顺便说一句,没有 position: top 这样的东西;font-size: 200 应该是 200%200em200px 等。

<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Full Width Responsive Image Slider</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://malsup.github.com/jquery.cycle2.js"></script>
<style type="text/css">
html,
body,
img {
padding: 0;
margin: 0;
height: 100%;
width: 100%
}

body {
font-family: Sans-Serif;
}

.container {
height: 100%;
width: 100%;
overflow: hidden;
}

.cycle-slideshow {
width: 100%;
display: block;
position: relative;
margin: 0 auto;
}

.cycle-prev,
.cycle-next {
font-size: 200%;
color: #FFF;
display: block;
position: absolute;
top: 50%;
margin-top: -16px;
z-index: 9999;
cursor: pointer;
}

.cycle-prev {
left: 10%;
}

.cycle-next {
right: 10%;
}

.cycle-pager {
width: 100%;
text-align: center;
display: block;
position: absolute;
bottom: 20px;
z-index: 9999;
}

.cycle-pager span {
text-indent: 100%;
white-space: nowrap;
;
width: 12px;
height: 12px;
display: inline-block;
border: 1px solid #FFF;
border-radius: 50%;
margin: 0 10px;
cursor: pointer;
}

.cycle-pager .cycle-pager-active {
background: #FFF;
}
</style>
</head>

<body>

<div class="container">

<!-- Full Width Responsive Slider -->

<div class="cycle-slideshow">
<span class="cycle-prev">&#9001;</span>
<span class="cycle-next">&#9002;</span>
<span class="cycle-pager"></span>
<img src="http://www.gettyimages.ca/gi-resources/images/Homepage/Category-Creative/UK/UK_Creative_462809583.jpg">
<img src="http://www.gettyimages.ca/gi-resources/images/Homepage/Hero/UK/CMS_Creative_164657191_Kingfisher.jpg">
<img src="http://3.bp.blogspot.com/-rZmCIp0C-hQ/Tx6aCFeweoI/AAAAAAAAAnQ/WqIEVBTIzRk/s1600/Cool-Tiger-Wallpaper-1920x1080-HD.jpg">
</div>

<!-- Full Width Responsive Slider -->


</body>

</html>

关于javascript - HTML,CSS,JQuery 网页正文垂直拉伸(stretch)过多,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34349271/

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