小智 5
这是文本框的 HTML:
<input type="text" name="whatever" id="funkystyling" />
Run Code Online (Sandbox Code Playgroud)
这是左侧图像的 CSS:
#funkystyling {
background: white url(/path/to/icon.png) left no-repeat;
padding-left: 17px;
}
Run Code Online (Sandbox Code Playgroud)
这是右侧图像的 CSS:
#funkystyling {
background: white url(/path/to/icon.png) right no-repeat;
padding-right: 17px;
}
Run Code Online (Sandbox Code Playgroud)