Heyy there, I have this text field I would like it to have a simpler border, but the left and top borders have a different(darker) color than the one I'm assigning them to be. I have been trying alot of different attributes in my CSS file.
this is the image
this is my css:
div#search_area input[type=text]{
width: 179px;
height: 23px;
background: -webkit-gradient(linear, left top, left bottom, from (#ffffff), to (#f5f5f5));
background: -webkit-linear-gradient(top, #ffffff, #f5f5f5);
background: -moz-linear-gradient(top, #ffffff, #f5f5f5);
background: -ms-linear-gradient(top, #ffffff, #f5f5f5);
background: -o-linear-gradient(top, #ffffff, #f5f5f5);
outline: 0;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
border-width: 1px;
border-color: rgb(228,229,228);
color: rgb(120,123,122);
font-size: 13px;
font-family: Arial, serif;
text-decoration: none;
vertical-align: middle;
padding: 0px 0px 0px 0px;
}
If you mean using two colours in the same border. Use e.g. border-right: 1px white solid; border-left: 1px black solid; border-top: 1px black solid; border-bottom: 1px white solid; there are special border-styles for this as well ( ridge , outset and inset ) but they tend to vary across browsers in my experience.
To achieve a multi-color border like shown above, we will use the position property and the ::after selector with a color gradient. First, we will make a header area using a HTML <div> class and then we will style it with CSS to have a multi-color border dividing it and the content below.
you need to also add
border-style: solid;
or dashed, or dotted, whichever one you want
This is because your border-style
is most likely set to inset
. If you change it to a different style, it won't create the "3D" effect that is causing the two different colors. See here for more details on border-style
https://developer.mozilla.org/en-US/docs/Web/CSS/border-style
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With