2016-09-18 6 views
0

ボタンの画像を矢印に変更できません。複数のものを試しましたが、うまく動作しませんでした。ボタンの背景画像を変更する

button .arrow{ 
 
     background-image: url("http://alexoliveira.me/Hawaii/images/chevron-left.png"); 
 
     background-repeat: no-repeat; 
 
     background-position: 50% 50%; 
 
     /* put the height and width of your image here */ 
 
     height: 50px; 
 
     width: 200px; 
 
     border: none; 
 
    } 
 
    
 
    .arrows { 
 
     width: 100%; 
 
     height: 100%; 
 
     display: flex; 
 
     align-items: center; 
 
     justify-content: space-between; 
 
     position:absolute; 
 
    
 
    }
<div class="arrows"> 
 
     \t \t <button onClick="carousel(-1)" class="arrow" style="width:20px;height:40px;"></button> 
 
     \t \t <button onClick="carousel(1)" src="http://alexoliveira.me/Hawaii/images/chevron-right.png" class="arrow" style="width:20px;height:40px;"></button> 
 
     \t </div>

答えて

1

だけ(スペースを削除)button.arrowためにあなたのCSSを更新します。あなたのスタイルシートを調整する必要があります

+0

背景:url(http://alexoliveira.me/Hawaii/images/chevron-left.png)no-repeat 50%50%transparent;多分? :-) –

+0

私はそれを使用してイメージを持ってかなりエクササイズ – Tahtoh

+0

はいあなたはあなたのボタンのあなたの幅と高さに合ったものを選択する必要があります –

関連する問題