1

please look this code:

<input type="text" /> (I need this with background color) <input type="text" style="background:gold;" /> <input type="text" style="background:gold;outline:0;" /> <input type="text" style="background:gold;-webkit-appearance:none;" /> 

how I can have background = gold without change border ?

if you do ZOOM then you see border-width change

PD: this Q is about background, not borders (change border color without changing border width)

2 Answers 2

0

Yes , i have looked your issue, please use the following code lines

input{

background: gold; border: 1px solid grey; border-radius: 2px; 

}

input:focus, input:focus-visible, input:hover{

 outline: 0; 

}

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks @Narendra you can see your code CHANGE border-width value.
-1

This is as close as it gets
check this post: changing backgroundColor changes border

<input type="text" /> <input type="text" style="background-color:gold;border:thin solid grey;border-radius: 2px;" />

9 Comments

thanks @Dibash Sapkota you can see the result is the same: border box is changed
You can change border color and also make border none
master @Dibash Sapkot can you see the difference into FIRST BOX and the others? Please do ZOOM, then you see: the border ORIGINAL is losed
Many thanks by your help master @Dibash Sapkota even when you use style="background-color:gold;border:thin solid grey the border-width change (please do ZOOM)
yes while changing input background default border properties are changed ,I tried to revert by JavaScript but it didn't happen
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.