是否可以创建仅包含文本而不是按钮的<input>标签?

3cr*_*oss 3 html css

我可以<input>只显示文字而不是按钮吗?我该怎么做?

Nei*_*ght 9

你可以使用CSS:

<input style="vertical-align:bottom;overflow:visible; font-size:1em; display:inline; margin:0; padding:0; border:0; border-bottom:1px solid blue; color:blue; cursor:pointer;" name="Submit" type="submit" value="Submit">


Wul*_*ulf 5

如果我答对了你的问题,你想显示一个 < input type="button" value="Foobar" /> 仅包含文本而没有按钮样式。

<input type="button" value="Foobar" style="border: none; background: none; padding: 0;" />
Run Code Online (Sandbox Code Playgroud)