2017-09-30 4 views

答えて

0

このanswerをchipChocolate.pyで、そして彼がhereを提供してくれました。 divが下から上に移動しているので、あなたが探しているのは正確ではありませんが、アイデアは同じです。 3つの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> 

は、その後、私はブートストラップ・アラートでフィドルhereを行っているこのCSS

.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) */ 
} 

を適用し、ページの上から中央に移行しました。それに応じて調整することができます。

関連する問題