I'd like to decorate a textfield by showing an icon as background-image (with background-repeat: no-repeat;) Now I need to maintain that the input-area starts a bit more to the right. I do that this way:
body {
max-width: 500px; }
#page {
background-color: #0000FF;
}
input[type='text'] {
background-color: #12eaec;
font-size: 24px;
padding: 4px 6px;
width: 80%;}
#line2 {
padding: 4px 30px;
}
<!DOCTYPE html>
<html lang="en">
<head>
<title>padding text fields problem</title>
</head>
<body>
<div id="page">
<input type="text" id="line1" placeholder="1 ... width = 80%" />
<input type="text" id="line2" placeholder="2 ... padded" />
</div>
</body>
</html>
But that results in the lower (padded) edit field to become wider than the other one.
How can I circumvent that?
Thanks!