2015-06-03 99 views
0

如何將箭頭放入按鈕盒?任何關於代碼的建議將不勝感激。用CSS移動PNG

HTML:

<!--Header--> 
<div class="mainHeader header"> 
    <h1> 
     LET US MAKE YOUR AWESOME IDEA HAPPENN 
    </h1> 
    <div class="button"> 
     <p class=""> 
      WATCH VIDEO 
     </p><img src="playbutton.png"> 
    </div> 
</div> 

CSS:

.button { 
    width: 250px; 
    height: 46px; 
    border: solid white 2px; 
    margin: 0 auto; 
    z-index: 2; 
    position: relative; 
    top: 70%; 
} 
.button p { 
    text-align: center; 
    font-size: 20px; 
    font-family: 'Teko', sans-serif; 
    color: white; 
    position: relative; 
    bottom: 20%; 
} 

http://codepen.io/anon/pen/RPpQPV

回答

0

body{ 
 
    background: #000; 
 
} 
 

 
button { 
 
    width: 250px; 
 
    height: 46px; 
 
    margin: 0 auto; 
 
    background: none; 
 
    border: solid white 2px; 
 
    z-index: 2; 
 
    position: relative; 
 
    text-align: center; 
 
    font-size: 20px; 
 
    font-family: 'Teko', sans-serif; 
 
    color: white;  
 
}
<button> 
 
     WATCH SHOWREEL 
 
     <img src="http://iconizer.net/files/Splashyfish/orig/arrow_medium_down.png"> 
 
     </button>

+0

非常感謝!但是,我現在如何將它定位在h1的下方?我是用相對位置和%來做的,但由於某種原因它現在不工作? –

+0

http://codepen.io/anon/pen/pJearm或http://codepen.io/anon/pen/waJyqE – Dmitriy