2016-04-15 17 views
0

私はウェブサイト(suprise、suprise)を作っていて、ページの上部にボタンがあり、クリックすると何もしません。私はそれを修正する方法が不思議です。ボタンを使ってページ上の特定のIDに移動する

ボタン

<button class="Learn-Link" href="#VideoSlide">Learn How 
<div class="Learn-Triangle"></div> 
</button> 

そして、私は

<div class="Slide" id="VideoSlide"> 
<!--More code here, but not relevant--> 
</div> 

答えて

0

buttonに旅行したい部分は、あなたのボタン

aタグを追加する必要がありますhref属性を持っていません

#VideoSlide{ 
 
    position: relative; 
 
    top:1000px; 
 
    height: 100px; 
 
    background: pink 
 
}
<button class="Learn-Link" ><a href="#VideoSlide">Learn How</a> 
 
<div class="Learn-Triangle"></div> 
 
</button> 
 
<div class="Slide" id="VideoSlide"> 
 
<!--More code here, but not relevant--> 
 
</div>

0

あなたはjavascript 例:を使用して、ボタンをトリガすることができます -

<button type="button" onclick="alert('Hello world!')">Click Me!</button> 
関連する問題