Html 创建一个仍粘贴在网站上的div
我正在尝试向我的网站添加一个提醒,它会贴在我的屏幕底部,并在与网站一起滚动时滚动。我已经用bootstrap建立了我的网站,所以我使用bootstrap框架。我被告知,该词缀允许在网站上滚动警报,但事实并非如此。我们正在使用codeignitor,因此我们加载视图,警报是加载的视图之一 我尝试按照以下步骤操作: 在这里: 但是没有用 它有以下内容Html 创建一个仍粘贴在网站上的div,html,css,twitter-bootstrap,affix,Html,Css,Twitter Bootstrap,Affix,我正在尝试向我的网站添加一个提醒,它会贴在我的屏幕底部,并在与网站一起滚动时滚动。我已经用bootstrap建立了我的网站,所以我使用bootstrap框架。我被告知,该词缀允许在网站上滚动警报,但事实并非如此。我们正在使用codeignitor,因此我们加载视图,警报是加载的视图之一 我尝试按照以下步骤操作: 在这里: 但是没有用 它有以下内容 <div class="alert alert-danger alert-dismissable data-spy="affix""> &
<div class="alert alert-danger alert-dismissable data-spy="affix"">
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
<strong>Bear With Us!</strong> We're currently building the site so expect some bugs!
</div>
我已尝试将此更改为:
<div data-spy="affix" data-offset-top="50">
<div class="alert alert-danger alert-dismissable">
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
<strong>Bear With Us!</strong> We're currently building the site so expect some bugs!
</div>
</div>
但这样做时,警报会完全从屏幕上消失。有人能给我一个指向这个的指针吗?我做了这个,它成功了,下面是
.底部{
宽度:100%;
高度:50px;
位置:固定;
底部:0;
背景色:黑色;
}
都铎先生{
宽度:100%;
高度:2000px;
}
div class=“all”只是用来填充页面,以便向下滚动
我这样做了,效果很好,下面是
.底部{
宽度:100%;
高度:50px;
位置:固定;
底部:0;
背景色:黑色;
}
都铎先生{
宽度:100%;
高度:2000px;
}
div class=“all”只是用来填充页面,以便向下滚动
谢谢,但它对我的代码不起作用,我在索引中做的是我的警报是包含代码的视图,这样做时,它只是停留在视图的底部,在缩略图和警报之间,而不是跟随页面,我相信这是codeigniter/MVC问题,但我不确定,谢谢,但它对我的代码不起作用,我在索引中所做的是,我有一个警报是包含代码的视图,这样做时,它只是停留在视图的底部,在缩略图和警报之间,而不是跟随页面,我相信这是codeigniter/MVC问题,但我不确定
<div data-spy="affix" data-offset-top="50">
<div class="alert alert-danger alert-dismissable">
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
<strong>Bear With Us!</strong> We're currently building the site so expect some bugs!
</div>
</div>
.alert {
position: fixed;
}
.affix {
top:50px;
position:fixed;
}
<style>
.bottom{
width:100%;
height: 50px;
position: fixed;
bottom:0;
background-color: black;
}
.tudo{
width:100%;
height:2000px;
}
</style>
<div class="all"></div>
<div class="bottom"></div>