When adding a button to a web page, we recommend you use CSS to create its styling. Utilizing CSS is the preferred method, being a more efficient and organized way to store style code for reuse in more than one area on your page or site. As you can see with the example below, many attributes can manipulate each button type.
CSS text for button styling
HTML code for creating the button
After the CSS is added to the page that CSS can be applied to any button using the id=“submit” code in the HTML.
Example of button created by the CSS
Example Button
You can see from the example above that when the mouse is not hovering over the button, the button has a light gray background and white text. When the mouse hovers over the button, the background changes to orange. Also, the corners of the button are rounded instead of squared off, like a standard form button.
Related information
- See our HTML help page for further information and related links.
- HTML and web design help and support.