Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 如何访问按钮文本中的第一个单词_Html_Css_Button_Underline - Fatal编程技术网

Html 如何访问按钮文本中的第一个单词

Html 如何访问按钮文本中的第一个单词,html,css,button,underline,Html,Css,Button,Underline,这是我的密码 <button class="mcnTextContent" type="button" style="text-decoration:underline">Click here to Reactivate your account before Feb. 1, 2016 for FREE</button> 点击此处在2016年2月1日前免费重新激活您的帐户 我想让第一个单词(单击)只带下划线。有人能帮我弄清楚吗 谢谢您可以像这样将单词Click包装成

这是我的密码

<button class="mcnTextContent"  type="button" style="text-decoration:underline">Click here to Reactivate your account before Feb. 1, 2016 for FREE</button>
点击此处在2016年2月1日前免费重新激活您的帐户
我想让第一个单词(单击)只带下划线。有人能帮我弄清楚吗


谢谢

您可以像这样将单词Click包装成一个样式
span

<button class="mcnTextContent"  type="button"><span style="text-decoration:underline">Click</span> here to Reactivate your account before Feb. 1, 2016 for FREE</button>
HTML

<button class="mcnTextContent"  type="button">
    <span id="underline">Click</span> here to Reactivate your account beforeFeb. 1, 2016 for FREE
</button>

单击此处在2月之前重新激活您的帐户。2016年1月1日免费


单击此处免费在2016年2月1日前重新激活您的帐户

您能否详细说明为什么内嵌式样式不好。我正要推荐它。(行内含义是用右键环绕“单击”)行内样式是指标记的
样式
属性。i、 e
,不建议这样做,因为这会增加您的
HTML
代码长度,并且很难维护
<button class="mcnTextContent"  type="button">
    <span id="underline">Click</span> here to Reactivate your account beforeFeb. 1, 2016 for FREE
</button>
<button class="mcnTextContent"  type="button" >
    <span style="text-decoration:underline;">Click</span> here to Reactivate your account before Feb. 1, 2016 for FREE
</button>