Canvas strips out custom CSS, which your code uses, and your tabs depend on. If you are an admin, you can add the CSS to the Canvas account: How do I upload custom JavaScript and CSS files to... - Instructure Community - 253 .
Without that permission, what usually works to make tabs within Canvas is the following:
<div class="enhanceable_content tabs">
<ul>
<li><a href="#fragment-1">PUT TITLE FOR TAB HERE</a></li>
<li><a href="#fragment-2">PUT TITLE FOR TAB HERE</a></li>
<li><a href="#fragment-3">PUT TITLE FOR TAB HERE</a></li>
</ul>
<div id="fragment-1">PUT THE CONTENT FOR THE FIRST TAB HERE</div>
<div id="fragment-2">PUT THE CONTENT FOR THE SECOND TAB HERE.</div>
<div id="fragment-3">PUT THE CONTENT FOR THE THIRD TAB HERE</div>
</div>
But note that Instructure has suggested that the enhanceable_content class will be deprecated at some point, and indeed some parts of the website already don't seem to allow it (such as New Quizzes).
What you can use that provides similar functionality is HTML details/summary tags: HTML summary Tag