2016-11-23 6 views
0

この例のように、このバナーの中央にテキスト、ロゴなどを含むdivを挿入するにはどうすればよいですか?別のdiv内の画像の上にdivを置く方法は?

<div class="banner">  
    <img src="img/banner2.jpg" width="100%" alt="Nasajon Sistemas"> 
</div> 

例:

enter image description here

マイページ

enter image description here

+1

可能な重複http://stackoverflow.com/questions/806000/how-do-i-give-テキストまたはイメージの透明な背景を使用して) – esote

+0

画像をここに入れて – Vickyexpert

+0

コードブロックの周りのコメントは必要ありません。 – iblamefish

答えて

0

ここでは、あなたのニーズに合うことができる例があります:

.center{ 
    text-align:center; 
    width:200px; 
    height:100px; 
    background-color:red; 
    position:absolute; 
    top: 50%; 
    left:50%; 
    margin-left:-100px; 
    margin-top:-50px; 
} 

.outter{ 
    width:100%; 
    height: 500px;; 
    background-color:black; 
} 


<div class="outter"> 

    <div class="center"> 
    <h1>Mywebsite</h1> 
    </div> 

</div> 

https://jsfiddle.net/alexcuria/uunwbqyb/

[私はCSSを使用して、テキストやイメージに透明な背景を与えるにはどうすればよい?]の(
+0

ありがとうsoo much ^^ –

関連する問題