2017-10-12 2 views
0

Meine Frage ist ziemlich einfach. Wie stelle ich die Grenze links und oben auf die gewünschte Farbe ein?CSS3 Warum Eingabe [Typ = Text] 's Grenze links und oben sind schwarz?

input.comment-input { 
 
    width: 60%; 
 
    border-color: #2bb6c1; 
 
    border-width: 1px; 
 
} 
 

 
input.comment-input, 
 
button.btn-comment { 
 
    font-size: inherit; 
 
    padding: 0.2em; 
 
    margin: 0.1em 0.2em; 
 
    -moz-box-sizing: content-box; 
 
    -webkit-box-sizing: content-box; 
 
    box-sizing: content-box; 
 
} 
 

 
button.btn-comment { 
 
    width: 50px; 
 
    text-align: center; 
 
    color: #2bb6c1; 
 
    background-color: #fff; 
 
    border: dashed 1px #2bb6c1; 
 
    font-size: inherit; 
 
}
<input type="text" class="comment-input"> 
 
<button type="button" class="btn-comment">input</button>

Hier ist die Js-Fiddle

Antwort

0

Verwendung border-left und border-top Eigenschaft für dieses

border-left:1px solid red; //set you want color 
border-top:1px solid red; //set you want color 

input.comment-input { 
 
    width: 60%; 
 
    border-color: #2bb6c1; 
 
    border-width: 1px; 
 
    border-left: 1px solid red; 
 
    border-top: 1px solid red; 
 
} 
 

 
input.comment-input, 
 
button.btn-comment { 
 
    font-size: inherit; 
 
    padding: 0.2em; 
 
    margin: 0.1em 0.2em; 
 
    -moz-box-sizing: content-box; 
 
    -webkit-box-sizing: content-box; 
 
    box-sizing: content-box; 
 
} 
 

 
button.btn-comment { 
 
    width: 50px; 
 
    text-align: center; 
 
    color: #2bb6c1; 
 
    background-color: #fff; 
 
    border: dashed 1px #2bb6c1; 
 
    font-size: inherit; 
 
}
<input type="text" class="comment-input"> 
 
<button type="button" class="btn-comment">input</button>

+0

Das ist Arbeit! Vielen Dank. Also, was ist der richtige Weg, um die Farbe der Grenze zu setzen? Muss ich jedes Mal Rand oben und Rand links einzeln schreiben? – Akito

+0

ja kannst du schreiben – Bhargav

0

Vermissen Sie border-style?

input.comment-input { 
    width: 60%; 
    border-color: #2bb6c1; 
    border-width: 1px; 
    /*border-style*/ 
    border-style: dashed 
} 
Verwandte Themen