Create a Button in Canvas
We're all familiar with creating links in Canvas but you can enhance your course appearance and emphasize a call to action with html buttons. This guide explains the process of adding a button to your Canvas course and provides you with the code to make it simple:
- Open the RCE anywhere in Canvas.
- Toggle to the HTML view.
- Paste the button html code <p><a class="btn btn-Size btn-primary" href="Link Goes Here">Button Text Goes Here</a></p>
- Change the size, link, and button text placeholders in the copied code.
- Save your changes.
HTML code must be exact to work correctly. Ensure you:
- Enter your replacements exactly where placeholders are located in copied code.
- Do not accidentally replace any of the other characters when inputting your new values.
- Avoid extra spacing or duplicating punctuation that is not represented in the code provided.
Need more detail?
Delve into the in-depth walkthrough below, complete with images and various notes for every step.
Step 1: Open the RCE
Head to any area within Canvas that has the Rich Content Editor (RCE). This is the space where you edit content in Pages, Assignments, Announcements, Discussions, and more.
![](https://attachment.freshservice.com/inline/attachment?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MTcwNTQ4NjUxNDUsImRvbWFpbiI6InVpdy5mcmVzaHNlcnZpY2UuY29tIiwidHlwZSI6MX0.DGHO_ON-z25kmOMnWUIwudKjnJWRzH9-tfvddfoljrg)
Step 2: Switch to HTML View
Click on the HTML toggle button to switch from the what-you-see-is-what-you-get (WYSIWYG) view. Note, the HTML editor can be utilized to customize your course, but not all code is accepted by Canvas. Canvas Help agents do not provide support for these types of custom solutions.
![](https://attachment.freshservice.com/inline/attachment?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MTcwNTQ4NjU3NzYsImRvbWFpbiI6InVpdy5mcmVzaHNlcnZpY2UuY29tIiwidHlwZSI6MX0.DiP4nIy8J8k6OK8boC90yckFPDjE-6fXRlwxI6RUfN4)
Step 3: Paste the Code
Copy this line of code and paste it where you'd like to insert your button:
<p><a class="btn btn-Size btn-primary" href="Link Goes Here">Button Text Goes Here</a></p>
![](https://attachment.freshservice.com/inline/attachment?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MTcwNTQ4NjU4ODcsImRvbWFpbiI6InVpdy5mcmVzaHNlcnZpY2UuY29tIiwidHlwZSI6MX0.wQ0K0bGrkXF7Ku3qn0NnyMFNVExDYEjTKKZScW0VXyI)
For this code to work, you must replace three placeholders in the pasted code with information relevant for your button. Steps 4, 5, and 6 walk through that process.
![](https://attachment.freshservice.com/inline/attachment?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MTcwNTQ4NjczNzEsImRvbWFpbiI6InVpdy5mcmVzaHNlcnZpY2UuY29tIiwidHlwZSI6MX0.spRapMv18yMT2hcigV5wpwhbdei__mbDpdg_qHFdz6w)
Step 4: Customize the Size Placeholder
There are four sizes of buttons you can use in Canvas by replacing the word Size in the code provided with mini, small, group, or large.
<p><a class="btn btn-Size btn-primary" href="Link Goes Here">Button Text Goes Here</a></p>
- Mini-sized button = mini
- Small button = small
- Medium button = group
- Large button = large
![](https://attachment.freshservice.com/inline/attachment?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MTcwNTQ4NjczMTQsImRvbWFpbiI6InVpdy5mcmVzaHNlcnZpY2UuY29tIiwidHlwZSI6MX0.QpJ5LpjG6gLLpSM3kiFDDT6wnQAEVum-rZCsThYgcyw)
![](https://attachment.freshservice.com/inline/attachment?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MTcwNTQ4NjcwNzUsImRvbWFpbiI6InVpdy5mcmVzaHNlcnZpY2UuY29tIiwidHlwZSI6MX0.YXRwPoKSAVXgeNrjRRiaTBlqDgvE57CUybp7pjnNoCo)
Step 5: Customize the Link Placeholder
Replace Link Goes Here with the URL you'd like the button to route people to. It is recommended to use buttons for locations outside your Canvas course, called external links. Using a button for a link within your Canvas course will not work once you copy your course for a future term. Any internal links must be updated for the next group of students to not receive an error that they do not have access.
<p><a class="btn btn-Size btn-primary" href="Link Goes Here">Button Text Goes Here</a></p>
![](https://attachment.freshservice.com/inline/attachment?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MTcwNTQ4Njc2MzgsImRvbWFpbiI6InVpdy5mcmVzaHNlcnZpY2UuY29tIiwidHlwZSI6MX0.aOIXqEonGpI1cKNSO4cq7c8bSmMO-BQkwHyU4wsqqW4)
Step 6: Customize the Text Placeholder
Replace Button Text Goes Here with the text you'd like to display on the button.
<p><a class="btn btn-Size btn-primary" href="Link Goes Here">Button Text Goes Here</a></p>
![](https://attachment.freshservice.com/inline/attachment?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MTcwNTQ4Njc2NjMsImRvbWFpbiI6InVpdy5mcmVzaHNlcnZpY2UuY29tIiwidHlwZSI6MX0.V7-rIM-8WEPF3o5Vom91nwMMf7uxexhpaAk4OpeuWTM)
Step 7: Leave HTML View
When you click the HTML toggle button, Canvas will switch back to the what-you-see-is-what-you-get (WYSIWYG) view. Don't be alarmed that you don't see a button yet, the appearance only displays correctly once your work is saved in the next step. Even though this step is optional, it is how you can ensure your button is located in the place you want within your other content.
![](https://attachment.freshservice.com/inline/attachment?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MTcwNTQ4Njc4NzQsImRvbWFpbiI6InVpdy5mcmVzaHNlcnZpY2UuY29tIiwidHlwZSI6MX0.Si0szywumoFaVE5io9LREDI3m8O44cJ4HTUYaIeq17k)
Step 8: Save Your Work
Click Save once you've replaced the placeholders, then ensure your button routes exactly where you intended it to go.
![](https://attachment.freshservice.com/inline/attachment?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MTcwNTQ4NjgxNjQsImRvbWFpbiI6InVpdy5mcmVzaHNlcnZpY2UuY29tIiwidHlwZSI6MX0.rTk62-fbZfgBvu8Li99VP6c2aWcRV-UPy47wP0jrWQo)
Buttons in Canvas FAQ
Are there additional ways to customize a button?
Yes. You can adjust the width with the code by percentage of the Canvas space or change the background and font colors with Hex codes.
-
Change the Width: <p><a class="btn btn-Size btn-primary" style="width: 50%;" href="Link Goes Here">Button Text</a></p>
-
Change the Background and Font Colors: <p><a class="btn-Size btn-info btn" style="background: #000000; color: #ffffff;" href="Link Goes Here">Button Text Here</a></p>
-
Change the Width and Colors: <p><a class="btn-Size btn-info btn" style="width: 50%; background: #000000; color: #ffffff;" href="Link Goes Here">Button Text Here</a></p>
![](https://attachment.freshservice.com/inline/attachment?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MTcwNTQ4Njg0MjgsImRvbWFpbiI6InVpdy5mcmVzaHNlcnZpY2UuY29tIiwidHlwZSI6MX0.56ZUImWq6ZEeJAozbA85OIaqDc1JzbEsawj6fM_8G2I)
Why is my button showing an error?
Your placeholder values not replaced correctly, or your link not being copied properly, can both lead to errors. Remember, HTML code must be precise for it to work correctly. Carefully examine your work for exact match to the instructions.
![Link error stating 'this page can't be reached'](https://attachment.freshservice.com/inline/attachment?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MTcwNTQ4Njg2MjksImRvbWFpbiI6InVpdy5mcmVzaHNlcnZpY2UuY29tIiwidHlwZSI6MX0.daJLb0OGPMaHebE2ocvi1I8G7C6EPaUm14w9suloQE0)
How can I efficiently manage buttons?
Often you will find yourself needing the same button in more than one place in your classroom. Create an unpublished Canvas page (or even a Word document) that you can paste the button's code into for easy access the next time you need it.
Can buttons be copied?
Yes. In Edit mode, buttons can be selected and copied, then pasted into another Canvas location without needing to go into the HTML Editor.
How can I easily change the title of a button?
The title of a button can be edited directly from the Rich Content Editor, without having to go into the HTML Editor.
![For tech help call 210 829 2721 or email helpdesk@uiwtx.edu](https://attachment.freshservice.com/inline/attachment?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MTcwNDYyMzczNjIsImRvbWFpbiI6InVpdy5mcmVzaHNlcnZpY2UuY29tIiwidHlwZSI6MX0._bn8gOIB-VCnSyCTPVODDQgVL1Nvxlqwc5d60yA8tfw)