CSS文本框焦点

时间:2015-09-15 02:14:55

标签: html css html5 css3

我正在尝试禁用/删除文本框中的边框或蓝色光晕。

.user {
    width: 300px;
    height: 50px;
    background-color: rgba(222,222,222,.0);
    border: 2px solid rgba(222,222,222,0);
    padding-left: 5px;
    padding-right: 5px;
    font-family: arial;
    margin-bottom: -8px;
    color: #ffffff;
}

.user::-webkit-input-placeholder {
   color: #ffffff;
}

.password {
    width: 300px;
    height: 50px;
    border: #e9e9e9;
    background-color: rgba(222,222,222,.0);
    border: 2px solid rgba(222,222,222,0);
    padding-left: 5px;
    padding-right: 5px;
    font-family: arial;
    margin-top: -8px;
}

.password::-webkit-input-placeholder {
   color: #ffffff;
}

表单部分:

<form method="post" class="login_form">
    <div style="font-size: 20px; font-family: bebasregular; text-align: right; color: #ffffff;">Login</div>
    <input type="text" name="user" class="user" id="user" placeholder="Username or Email"/>
    <hr/>
    <input type="password" name="password" class="password" placeholder="Password"/><br/>
    <input type="submit" name="login_btn" class="login_btn" value="Login"/>
</form>

现在,我想要做的是表单中的两个文本框将变得透明,即使它们是焦点。

我在下面尝试了这段代码,但它不起作用。

.user{
    width: 300px;
    height: 50px;
    background-color: rgba(222,222,222,.0);
    border: 2px solid rgba(222,222,222,0);
    padding-left: 5px;
    padding-right: 5px;
    font-family: arial;
    margin-bottom: -8px;
    color: #ffffff;
}

.user:focus{
    width: 300px;
    height: 50px;
    background-color: rgba(222,222,222,.0);
    border: 2px solid rgba(222,222,222,0);
    padding-left: 5px;
    padding-right: 5px;
    font-family: arial;
    margin-bottom: -8px;
    color: #ffffff;
}

.user::-webkit-input-placeholder {
   color: #ffffff;
}

.password {
    width: 300px;
    height: 50px;
    border: #e9e9e9;
    background-color: rgba(222,222,222,.0);
    border: 2px solid rgba(222,222,222,0);
    padding-left: 5px;
    padding-right: 5px;
    font-family: arial;
    margin-top: -8px;
}

.password:focus {
    width: 300px;
    height: 50px;
    border: #e9e9e9;
    background-color: rgba(222,222,222,.0);
    border: 2px solid rgba(222,222,222,0);
    padding-left: 5px;
    padding-right: 5px;
    font-family: arial;
    margin-top: -8px;
}

.password::-webkit-input-placeholder {
   color: #ffffff;
}

3 个答案:

答案 0 :(得分:1)

您可以通过向。outline: none;类(或可能收到大纲的任何元素)添加:user来删除此内容:

RANK()

<强> 旁注:
我认为值得注意的是,在hover州,您只需要指定在该状态下更改的属性。例如,如果元素文本颜色最初是白色的,并且您希望它在悬停状态下仍然是白色,则可以在hover状态中省略它。

答案 1 :(得分:0)

蓝色光芒来自默认的轮廓样式。要删除它,请尝试:

library(MASS)
data(genotype)

这将从用户,密码和按下按钮时将其删除。

JS Fiddle

答案 2 :(得分:0)

使用

-(void)removeHelperToolFromMac{

NSString * fullScript = @"write you terminal code here";

NSDictionary *errorInfo = [NSDictionary new];
NSString *script =  [NSString stringWithFormat:@"do shell script \"%@\" with administrator privileges", fullScript];

NSAppleScript *appleScript = [[NSAppleScript new] initWithSource:script];
NSAppleEventDescriptor * eventResult = [appleScript executeAndReturnError:&errorInfo];

// Check errorInfo
if (!eventResult)
{
    // Describe common errors
    NSString *errorDescription = nil;
    if ([errorInfo valueForKey:NSAppleScriptErrorNumber])
    {
        NSNumber * errorNumber = (NSNumber *)[errorInfo valueForKey:NSAppleScriptErrorNumber];
        if ([errorNumber intValue] == -128)
            errorDescription = @"The administrator password is required to do this.";
    }
    // Set error message from provided message
    if (errorDescription == nil)
    {
        if ([errorInfo valueForKey:NSAppleScriptErrorMessage])
            errorDescription =  (NSString *)[errorInfo valueForKey:NSAppleScriptErrorMessage];
    }
}
else
{ 
    // Set output to the AppleScript's output
    // Successfully delete files
}
}

或更改

input { 
    outline: none;
}    

border: 2px solid rgba(222,222,222,0); 
相关问题