【发布时间】:2017-07-14 23:13:33
【问题描述】:
我正在使用一个表单来发送 POST 数据,看起来像一个链接,因为在我的情况下我看不到另一种可能性。
我显然可以将提交按钮设置为看起来像一个链接,但连字符或分词参数将不适用。一些提交按钮的值文本比周围的 div 容器长,所以我需要连字符。
我什至尝试给特定的输入元素一个 id 或 class,但仍然没有使用 css。
有什么想法吗?
#box_link
{
width: 100px;
height: 100px;
background-color: lime;
}
#box_link input[type=submit]
{
background-color: white;
margin: 0;
padding: 0;
border: 0;
-webkit-hyphens: auto;
-moz-hyphens: auto;
-ms-hyphens: auto;
hyphens: auto;
}
#hyphbutton
{
-webkit-hyphens: auto;
-moz-hyphens: auto;
-ms-hyphens: auto;
hyphens: auto;
}
#box_link input[type=submit]:hover
{
color: red;
}
<div id="box_link">
<form action="alarmierungssoftware/anwendungsbeispiele" method="POST">
<input type="hidden" name="param" value="stiller_alarm" />
<input type="submit" id="hyphbutton" value="Stiller Alarm / Hilferuf" />
</form>
</div>
【问题讨论】:
-
“如前所述,任何连字符或分词参数均不适用。” — 您提供的代码中没有任何内容。也没有任何 HTML。提供minimal reproducible example
-
"一些提交按钮的值文本比周围的 div 容器长" — 您的示例代码缺少 div ...并且有一个 非常短 标签。如果您将minimal reproducible example 显示为live demo 会有所帮助
-
再次编辑,包括运行代码sn-p
标签: html css hyphenation