我使用CSS样式在我的网站上的输入按钮,但在IOS设备上的样式被Mac的默认按钮所取代。是否有一种方法可以为iOS设置按钮样式,或者有一种方法可以让一个超链接表现得像一个提交按钮?
你可能正在寻找
-webkit-appearance: none;
Safari CSS注释-webkit-appearance Mozilla Developer Network的-moz-appearance
我自己最近也遇到了这个问题。
<!--Instead of using input-->
<input type="submit"/>
<!--Use button-->
<button type="submit">
<!--You can then attach your custom CSS to the button-->
希望这能有所帮助。
请添加此css代码
input {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
使用下面的css
输入(type =“提交”){ 字体大小:20 px; 背景:粉色; 边界:没有; 填充:10px 20px; } .flat-btn { -webkit-appearance:没有;/ * * /铬 - Mozilla -appearance: none 外观:无; border - radius: 0; } h2 { Margin: 25px 0 10px; 字体大小:20 px; } <h2>iOS样式按钮!< / h2 > <input type="submit" value="iOS样式按钮!"/> <h2>不再有风格!按钮!< / h2 > <input class="flat-btn" type="submit" value="No More Style! "按钮!”/>
今天我在使用primefaces (primeng)和angular 7时也遇到了同样的问题。 将以下内容添加到style.css中
p-button {
-webkit-appearance: none !important;
}
我还使用了一些bootstrap,其中有一个reboot.css,这覆盖了它(这就是为什么我必须添加!重要)
button {
-webkit-appearance: button;
}