Twitter bootstrap 3 如何使引导3警报从屏幕顶部飞入中心

Twitter bootstrap 3 如何使引导3警报从屏幕顶部飞入中心,twitter-bootstrap-3,Twitter Bootstrap 3,我一直在到处寻找一些例子,比如Bootstrap3警报框从屏幕顶部飞入,在所有元素顶部的中央屏幕结束 我发现很多都很有趣。modals,但如何实现警报框的此行为?您可以通过chipChocolate.py和他提供的小提琴来查看此行为。 这并不是你想要的,因为div是从下到上移动的,但是想法是一样的。 创建三个分区:主容器、警报容器、警报内容 我对引导警报进行了修改,并从页面顶部过渡到了页面中部。你可以相应地调整它 <div class="main-container"> <

我一直在到处寻找一些例子,比如Bootstrap3警报框从屏幕顶部飞入,在所有元素顶部的中央屏幕结束


我发现很多都很有趣。modals,但如何实现警报框的此行为?

您可以通过chipChocolate.py和他提供的小提琴来查看此行为。 这并不是你想要的,因为div是从下到上移动的,但是想法是一样的。 创建三个分区:主容器、警报容器、警报内容

我对引导警报进行了修改,并从页面顶部过渡到了页面中部。你可以相应地调整它

<div class="main-container">
  <div class="alert-container">
  <!-- placeholder image -->
  <img class="inner_img" src="http://placehold.it/1000x1000" />
    <div class="alert-content">
      <div class="alert alert-danger">
         <strong>Danger!</strong> This alert box could indicate a dangerous or potentially negative action.
        </div>
    </div>
  </div>
</div>
.main-container{
 position: relative; /* Set to absolute */
}
.alert-container {
 position: absolute; /* Set to absolute and positioned at top corner*/
 top: 0;
 left: 0;
}
.alert-content {
 position: absolute;   /* This moves it to the bottom (initial state) */
 bottom: 90%; 
 width: 100%;
 height: 10%;
 transition: bottom 1s;
}
.main-container:hover .alert-content {
  bottom: 50%;   /* This moves it to the middle (only on hover) */
}