- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试构建一个带有侧边栏和主要内容右侧的网站。尽管我已经尝试了多种方法来让它工作,但它的表现并不如我所愿。本质上,我希望它们在溢出整个页面 div
时都滚动。
<!DOCTYPE html>
<html lang = "en-US">
<head>
<meta charset = "utf-8">
<meta http-equiv = "X-UA-Compatible" content = "IE=edge">
<meta name = "viewport" content = "width=device-width, initial-scale=1">
<title>Glocal Impacts</title>
<link rel = "stylesheet" type = "text/css" href = "css/bootstrap.css">
<link rel = "stylesheet" type = "text/css" href = "css/stylesheet.css">
<script src = "https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src = "https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<script type = "text/javascript" src = "js/jquery.js"></script>
<script type = "text/javascript" src = "js/bootstrap.js"></script>
<script type = "text/javascript" src = "js/matchHeight.js"></script>
<script type = "text/javascript" src = "js/app.js"></script>
</head>
<body>
<div class = "fullBG"
style = "background-image: linear-gradient(
rgba(0, 0, 0, 0.5),
rgba(0, 0, 0, 0.5)),
url('pic/health.jpg');">
<div class = "homeSide">
<ul>
<li><a href = "index.html">Home</a></li>
<li><a href = "about.html">About Glocal</a></li>
<li><a href = "team.html">Team</a></li>
<li><a href = "itinerary.html">Itinerary</a></li>
<li><a href = "service.html">Service Learning</a></li>
<li><a href = "trip.html">Upcoming Trips</a></li>
<li><a href = "alumni.html">Ask an Alumni</a></li>
<li><a href = "blog.html">Blog + Gallery</a></li>
<li><a href = "apply.html">Apply</a></li>
<li><a href = "contact.php">Contact</a></li>
<li><a href = "donate.html">Donate</a></li>
</ul>
</div>
<div class = "homeMain" style = "display: block">
<div class = "content">
<h1 id = "orphan">Touch an Orphan's Life</h1>
<p>A visit to an orphanage in Fez is an experience that our participants usually list as most memorable and one that has had the most impact on their lives. Students get to interact with mostly abandoned kids that range in age from few days to twelve years old. Participants have donated clothing and cash to help the day to day operation of the orphanage. Some of our students have even donated to the employees of the orphanage in a show of appreciation to their dedication and selflessness. Get your handkerchiefs ready, this has always been a good idea.</p>
<img class = "img-responsive" src = "pic/orphan.jpg">
<h1 id = "school">Maisa's School Supplies</h1>
<p>Students and their parents have come through in a major way when it came to donating school supplies. In fact, this project is named after the mother of one our alumni, Maisa, who has been examplary in this area and has procured countless school supplies. We encourage all participants and their families to follow suit and help us collect these supplies to bring on the trip and hand them directly to a group of needy and well deserving children.</p>
<img class = "img-responsive" src = "pic/school.jpg">
<h1 id = "clothes">Clothing Donations</h1>
<p>Lighten up the load in your overstuffed closet by getting rid of clothes that you have either outgrown or have no use for, and donate them to someone who needs them. Donating new, unworn or gently used clothing helps alleviate the pain of those who are in need and provides participants with an opportunity to affect change in a world plagued with sharp disparities. Pack an extra bag and get ready to donate its content directly to those who are to benefit from it. We have a close working relationship with an orphanage in the city of Fez. We will also make some impromptu stops as you travel through the Atlas Mountains to donate clothes.</p>
<img class = "img-responsive" src = "pic/clothes.jpg">
<h1 id = "soccer">Project Soccer Ball</h1>
<p>Soon after you touch down in Morocco, you will realize that the sport of soccer or football, as it’s known around the world, is not just a sport. Its reconciling powers overcome all. Students are encouraged to bring in a soccer ball to donate to local kids and witness how much love and peace can come from a single soccer ball. Students who are grooming themselves for a career in diplomacy and politics tend to benefit tremendously from this experience.</p>
<img class = "img-responsive" src = "pic/soccer.jpg">
</div>
<div class = "social"><ul>
<li><a href = "https://twitter.com/moroccoprogram" target = "_blank"><img src = "icon/twitter.png"></a></li>
<li><a href = "https://www.facebook.com/moroccoprogram" target = "_blank"><img src = "icon/facebook.png"></a></li>
<li><a href = "https://www.youtube.com/channel/UC_BIg1VK3aqpGKuFVT2UCFA" target = "_blank"><img src = "icon/youtube.png"></a></li>
</ul></div>
</div>
</div>
</body>
</html>
如您所见,侧边栏和内容有三个滚动条,而不是一个滚动条。很奇怪,右边似乎还超过了左边。这是我的 HTML 和 LESS。有什么想法吗?
(附:Bootstrap 网格元素在内容面板中也不起作用)
@import "variables.less";
@text: #303031;
@foot: #373737;
@line: #93999a;
@main: #435573;
@tabs: #222c3c;
@accent: #b52b2c;
@height: 590px;
@font-face
{
font-family: Montserrat;
src: url("../fonts/Montserrat.woff2");
}
@font-face
{
font-family: Selima;
src: url("../fonts/Selima.otf");
}
@font-face
{
font-family: Avenir;
src: url("../fonts/Avenir.woff");
}
@font-face
{
font-family: Proxima;
src: url("../fonts/Proxima.otf");
}
@font-face
{
font-family: Euclid;
src: url("../fonts/Euclid.otf");
}
@font-face
{
font-family: Besom;
src: url("../fonts/Besom.ttf");
}
html, body
{
width: 100%;
height: 100%;
margin: 0px auto;
padding: 0px;
}
.navbar
{
font-family: Euclid;
font-size: 14px;
letter-spacing: 3px;
text-decoration: none;
margin-bottom: 0px;
}
.content
{
text-align: left;
background-color: white;
padding: 80px;
h1
{
font-family: Avenir;
font-size: 35px;
line-height: 40px;
color: black;
text-transform: none;
text-decoration: none;
letter-spacing: 1px;
margin-bottom: 5px;
}
ul
{
margin-bottom: 30px;
}
p
{
font-family: Proxima;
font-size: 16px;
line-height: 32px;
color: black;
font-weight: normal;
letter-spacing: 2px;
margin: 20px 0;
-webkit-hyphens: auto;
-moz-hyphens: auto;
-ms-hyphens: auto;
-o-hyphens: auto;
hyphens: auto;
text-align: justify;
}
li
{
font-family: Proxima;
font-size: 16px;
color: @text;
font-weight: normal;
letter-spacing: 2px;
margin: 15px 0;
-webkit-hyphens: auto;
-moz-hyphens: auto;
-ms-hyphens: auto;
-o-hyphens: auto;
hyphens: auto;
}
img
{
width: 100%;
margin: 30px 0;
}
}
.fullBG
{
background-color: #efefef;
background-repeat: no-repeat;
background-size: center center;
background-position: fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
width: 100%;
height: 100%;
}
.block
{
display: block;
padding: 75px 10px;
border: 2px solid white;
background: rgba(255, 255, 255, 0.2);
color: white;
text-align: center;
font-family: Avenir;
letter-spacing: 3px;
font-size: 25px;
}
.homeMain
{
display: flex;
min-height: 590px;
flex-direction: column;
padding-left: 250px;
max-height: 100%;
overflow-y: scroll;
}
.middle
{
flex: 1;
}
.fancy
{
font-family: Selima;
font-size: 80px;
line-height: 85px;
color: white;
text-transform: none;
text-decoration: none;
letter-spacing: 2px;
margin: 0px auto;
padding-top: 20px;
text-align: center;
}
.homeSide
{
position: absolute;
width: 250px;
height: 100%;
padding: 30px 0px;
background: trasparent;
max-height: 100%;
overflow-y: scroll;
ul
{
list-style-type: none;
margin: 0px auto;
li
{
font-family: Euclid;
font-size: 14px;
letter-spacing: 3px;
padding: 15px 10px;
a
{
text-decoration: none;
color: white;
width: 0px;
padding-bottom: 5px !important;
border-bottom: 2px solid transparent;
transition: 0.5s ease;
white-space: nowrap;
&:hover
{
border-bottom: 2px solid white;
width: 100%;
}
}
}
}
}
.footer
{
font-family: Euclid;
font-size: 14px;
letter-spacing: 3px;
background-color: @foot;
text-decoration: none;
padding: 20px;
text-align: center;
ul
{
list-style: none;
padding: 0px !important;
margin: 0px auto;
}
a
{
text-decoration: none;
color: white;
}
li
{
display: inline-block;
padding: 10px;
}
}
.social
{
font-family: Proxima;
font-size: 12px;
background-color: white;
text-transform: uppercase;
text-decoration: none;
letter-spacing: 2px;
padding: 20px;
text-align: center;
width: 100%;
img
{
-webkit-filter: brightness(100%);
&:hover
{
-webkit-filter: brightness(70%);
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-o-transition: all 1s ease;
-ms-transition: all 1s ease;
transition: all 1s ease;
}
}
ul
{
list-style: none;
padding: 0px !important;
margin: 0px auto;
}
a
{
text-decoration: none;
}
li
{
display: inline-block;
padding: 10px;
}
}
最佳答案
关于html - 边栏和内容 : Scroll Issues,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42457591/
我想使用 overflow: scroll(或 auto)完成比屏幕宽的图库预览。在右侧,与最后一张可见图像重叠的阴影应该表示右侧可以看到更多图像。 这是一个 fiddle :http://jsfid
我的网格面板的滚动条有问题。当我滚动到底部并试图再次向上滚动时,滚动条会自动向下滚动,防止我滚动到列表的顶部。。。我试着设置布局“合适”,或给面板一个特定的宽度和高度大小,但这些解决方案都不起作用。。
这段代码的作用是什么? var oldScrollPos = $(window).scrollTop(); $(window).on('scroll.scrolldisabler', fu
..对于这个元素,我会在某个时候烧脑。 10 小时后仍然没有任何消息。 溢出的元素在 Android stock 浏览器(目前在 s3 mini,android 4.1.2 上测试)中没有任何平滑度。
基本上,我想要的是固定标题、卡住 Pane 、表格,例如 http://www.cssplay.co.uk/menu/tablescroll.html 。然而,他的 table 有一个主要弱点。标题不
我在我的一个项目中使用 Twitter Bootstrap,但是我的内容超出了浏览器 View 的问题。通常您会在屏幕右侧看到滚动条,但在我的情况下没有。我在 overflow: hidden; 之后
是否有一个“有效”的解决方案可以使对话框随滚动条滚动,而不是仍然从内部窗口边界的中心固定? 在某些情况下,用户的分辨率可能太小而无法包含对话框,在这种情况下,部分对话框可能会被隐藏。您可能在隐藏部分有
这个问题在这里已经有了答案: 关闭 10 年前。 Possible Duplicate: hide scrollbar while still able to scroll with mouse/k
我希望能够水平滚动浏览一些文章,但它不起作用。我尝试在内容周围放置一个边框,这样一些内容就会被截断,这样我就可以滚动,但是当我这样做时文章会垂直对齐... 这是我正在使用的代码: HTML:
我已经使用 HSROLL 成功创建了一个组合框,如下所示: HWND find = CreateWindowEx(0, WC_COMBOBOX, _T(""), CBS_DROPDOWN | WS_V
我有一个 定位于 position:fixed .当窗口在水平方向上太小而无法容纳 div 时,不会出现滚动条,div 的右侧会被简单地切断。 如果我更改为 position:absolute,滚动条
我对这两个参数完全感到困惑, es.scroll.size es.scroll.limit 我做了一些测试,仍然不知道。 es.scroll.limit = es.scroll.size * num_
我正在尝试使用 skrollr 构建网站.这是jFiddle link对于我已经尝试过的。但是正如您所见,当 smoothScrolling 设置为 true 时,它不会按预期工作。当设置 smo
最近,我在一个网站上工作,我想在不同的滚动位置拍摄特定的效果。我正在使用 Velocity JS 制作动画。有一个元素我想自动滚动到另一个特定的滚动位置。这可以使用 Velocity JS 轻松实现。
继续追加,您会看到最新的聊天消息出现,但在某个点后它会停止自动向下滚动。我怎样才能解决这个问题?谢谢。 http://jsfiddle.net/VMcsU/ $("#button1").click(f
在我的代码中,y 滚动位置(以像素为单位)是滚动 Pane 的顶部: stage = new Stage(new StretchViewport(480, 800)); Image m
我有一个模态对话框,里面有一个可滚动的 div。 div 设置为 overflow: scroll; 但是,当用户在 div 中一直向下滚动时,弹出窗口后面的内容开始向下滚动。 问题:当弹出窗口打开时
我正在使用 AutoCompleteTextView 让我的 Android 应用程序的用户使用自定义网络服务搜索内容:它按预期工作,但目前我找不到实现“无尽滚动”的方法"在下拉 ListView 上
我在我的应用程序中使用工具栏并使用这个 link我隐藏了工具栏,它按预期完美工作。但是当列表只有一个/两个项目时,不需要滚动工具栏,因为底部有足够的空间。 隐藏工具栏背后的想法是当列表项超出屏幕高度时
我是 Ios 开发的新手,我在导航项中添加了一个 Searchbar我想要实现的是当我向上滚动 tableview我想隐藏 Searchbar 并在向下滚动时显示它 类似于 iPAD/Iphone 上
我是一名优秀的程序员,十分优秀!