I am implementing a project and when I try to set color white to my
input border
, it just turns into gray
instead of white
,but its just fine with other colors like red or orange except with black, I have the same issue with black.
code:
.add {
display: flex;
justify-content: center;
margin-bottom: 1.3rem;
border-color: white;
border-width: .3rem;
border-style: solid;
}
.addButton {
margin-left: 16.8rem;
position: absolute;
cursor: pointer;
font-size: 1.3rem;
}
.add input {
position: relative;
outline: none;
text-indent: .5rem;
font-size: 1.3rem;
}
.add input::placeholder {
font-size: 1.25rem;
}
<form class="add">
<input class="addBook" type="text" required maxlength="50" pattern="S(.*S)?" title="Your book name can't start or end with white space and should
include at least 1 non-white space character" placeholder="e.g Harry Potter" name="" id="">
<button class="addButton">Add</button>
</form>
2
Answers
Instead of setting the border in the
.add
class, set the border color in the other class.add input
According to this code, We can see the
border-color
property in our code adjust in form tag that containing input tag and button tag.If we give a
border-color: white;
property to input tag we can identify that border color of input tag changed into white, but the top and left side borders remain gray.Thru with new Image, I am sorry but I couldn’t clearly identify how the hierarchy of HTML elements is set
but I would like to suggest a way like below
border-style: none;
to input tag'border-color: white;'
to div tagThis may be far from what you want, and may not be a recommended method but I hope it will help you a little in the process of finding a solution.
Take care and have a peaceful Easter day🐣