[英]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.