【问题标题】:how to underline the access key in an input button如何在输入按钮中为访问键加下划线
【发布时间】:2016-06-20 19:32:27
【问题描述】:

我有一个按钮,我想在访问密钥字母下划线,<u></u> 不起作用,C̲ (C̲) 更改字体,应该是 verdana

    <input class="boton" type="button" value="C&#818;ancel" accesskey="C" onclick="cancel();"/>

在我的 css 中,我输入了字体类型:

input.boton{

font: bold 11px verdana !important;
color: #000;

 }

我该怎么做?

【问题讨论】:

  • 如果你使用css它不起作用? .boton{ font-family: "Verdana", 日内瓦, sans-serif !important; }

标签: html underline html-input


【解决方案1】:

没有可以应用的 HTML 实体会呈现下划线。在 value 属性中不能使用其他 HTML 标记,因此不能以这种方式呈现下划线。正如您所注意到的,使用 Unicode 结合低行可能会导致呈现不同的字体,因为您正在生成一个新字符,而您的主要字体可能会出现呈现问题。

因此,最好的解决方案可能是使用button,它允许任意 HTML 内容:

<button ...>C<u>a</u>ncel</button>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-10-21
    • 1970-01-01
    • 1970-01-01
    • 2018-01-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-03-26
    相关资源
    最近更新 更多