簡體   English   中英

如何在輸入標簽內設置按鈕樣式

[英]How to style a button inside an input tag

嘿,我試圖在此處更改此(工作)代碼行:

     *<a href="DPS_Guitarspg3.html">        
        <button style="background-color:rgb(0,0,5)"; type="button"> <p style="color:rgb(111,0,100);">  Guitars</p></button> </a>*

將這種格式(利用類)轉換為等效語句:

*<a href="DPS_Guitarspg3.html">
<input type="button" class="inline" id="redirectButtons">
</a>*

我的問題是在后面的代碼塊中如何/在何處鍵入上述代碼塊中使用的彩色文本(“ Guitars”)。 抱歉,如果這是一個不好的問題,我對HTML感到厭倦。 提前致謝。

您希望按鈕充當超鏈接。 為了使您能夠完全控制按鈕的樣式,可以將按鈕設置為圖像文件,然后將圖像文件放入超鏈接中。

<a href="DPS_Guitarspg3.html">
  <img src="image-of-button.png">
</a>

另外,您可以使用Bootstrap之類的前端庫。

或者,您可以設置<a>標記的樣式,使其看起來/像按鈕一樣。 只需使用:hover:active ,就像這樣

 .aBtn{ padding:5px 10px; text-decoration:none; color:rgb(111,0,100); background-color:rgb(0,0,5);border:1px solid transparent; } .aBtn:hover {color:white;} .aBtn:active{border:1px solid orange;} 
 <a class="aBtn" href="DPS_Guitarspg3.html">Guitars</a> 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM