Home › CSS Tutorial › CSS forms
CSS forms
Style inputs and buttons.
Style inputs with padding, border and radius. Set box-sizing:border-box so widths behave. Style :focus clearly.
Example code
<style>
input,textarea{width:100%;padding:10px;border:2px solid #aaa;border-radius:6px;box-sizing:border-box;margin:4px 0}
input:focus,textarea:focus{border-color:#2e86de;outline:none}
button{background:#2e86de;color:#fff;border:0;padding:10px 18px;border-radius:6px}
</style>
<input placeholder='Name'><textarea placeholder='Message'></textarea><button>Send</button>