Skip to main content

CSS Link Buttons

CSS can be used to make HTML links look like buttons.

Combine several CSS properties, such as background-color, padding, text-decoration, and display, to show links as boxes or buttons.

Filled button

A link styled as a solid red button that darkens on hover.

Prompt
An HTML page that styles a link as a filled button. In an internal <style> block, give a:link and a:visited a red (#f44336) background, white text, 14px 25px padding, centered text, no underline, and inline-block display. On a:hover and a:active, change the background to red. Add a link in the body.
Output: complete HTML page

Bordered button

A link styled as a bordered button that fills with green on hover.

Prompt
An HTML page that styles a link as a bordered button that fills on hover. In an internal <style> block, give a:link and a:visited a white background, black text, a 2px solid green border, 10px 20px padding, centered text, no underline, and inline-block display. On a:hover and a:active, set a green background and white text. Add a link in the body.
Output: complete HTML page