Campsite Coders

Learn CSS

Learn to code and become a Front End Web Developer

Campsite Coders Bootcamp Coding Advenuture

How to Style Buttons with CSS

Buttons on websites are used to perform an action. That action may be to submit a form or kick off a JavaScript action, or it could simply link to another web page. You can style a button's background color, border, font color, padding, margin, text alignment, font size, and more.

Link the Button ID or ClassName with a CSS Declaration.

In order to add styles to a button using CSS, you need to first give your button either a Class ID or a Class Name. You use Class ID when there is only one button on the page that you want to add the style rules too. When you have several buttons on the page and you want them to all have the same styles, you use a Class Name.

HTML

<button className="bigBlue" text="Submit" />

CSS

.bigBlue {background-color:blue; font-size:32em}

Campsite Coders Bootcamp Coding Adventure
Road Map for Coding Adventure One

Campsite Coders

56747 Ewing Rd

Moffat, CO 81143

720-515-1124

Campsite Coders logo in footer

Copyright 2023 . All rights reserved