7

使用以下代码:

<html>
<body>
<input type="submit" style="color: transparent; background-color: transparent; border-color: transparent; cursor: default;">
</body>
</html>

将此文件另存为 html 文件。如果您打开文件,则会有一个不可见但仍处于活动状态的按钮。按 T​​ab 选择按钮。现在仍然不可见的按钮周围有一个灰色的虚线矩形。有人可以帮我禁用那个矩形。感谢响应者

,我正在尝试制作一个完全不可见的站点登录,这是它唯一可见的部分,请帮助。

4

5 回答 5

19

您可以使用该样式outline: 0;在按钮获得焦点时禁用虚线矩形。

例子:

<input type="submit" style="outline: 0;">

不过,我不确定您要做什么是正确的...您只是想隐藏按钮吗?你最好的选择是使用display: none;

例子:

<input type="submit" style="display: none;">
于 2011-04-21T17:25:59.450 回答
5

这对我有用。(仅在 Opera 所以 YMMV 上测试过)。

<input type="submit" style="background:transparent; border:none; color:transparent;">

http://jsfiddle.net/AHsdJ/3/

于 2013-11-28T13:50:23.057 回答
1

使用 CSS :focus & :active 伪类

<html>
<head>
<style type="text/css">
input:focus, input:active { outline: none;}
</style>
</head>
<body>
<input type="submit" style="color: transparent; background-color: transparent; border-color: transparent; cursor: default;">
</body>
</html>
于 2011-04-21T17:32:27.487 回答
0

只需像您所做的那样使其透明,然后禁用该按钮。这对我来说非常有效。

<input type="submit" style="color: transparent; background-color: transparent; border-color: transparent; cursor: default;" disabled>
于 2017-04-10T19:22:43.090 回答
-1

根本不要使用按钮。

使用 AJAX 通过 post 发送登录数据并处理页面内的响应。

于 2013-03-28T13:49:01.527 回答