开发者

Totally invisible html buttons

Use the follo开发者_JAVA百科wing code:

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

Save this file as a html file. If you open the file there is an invisible but still active button. Press Tab to select the button. Now there is a grey dotted rectangle arround the still invisible button. Can someone help me to disable that rectangle. Thanks to responders

I'm trying to make a totally invisible site login, that's the only visible part of it, please help.


You can use the style outline: 0; to disable the dotted rectangle from the button when it's focused.

Example:

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

Though, I'm not sure what you are trying to do is correct... Are you just trying to hide the button? Your best bet is to use display: none;

Example:

<input type="submit" style="display: none;">


This works for me. (Only tested on Opera so YMMV).

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

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


Use CSS :focus & :active pseudo-classes

<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>


Just make it transparent as you what did, and then make the button disabled. This works perfectly for me.

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


Don't use a button at all.

Use AJAX to send login data via post and handle the response within your page.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜