Embed CSS in HTML
Already made a CSS stylesheet? However you don't know what to do with it? This article will show you how.
Steps
- Decide if you have a stylesheet on a different file or if you are embedding it on the html document.
- If you are embedding it on the html document, then all you need is the index html page. You can then add the CSS code to the top of the page and link it to where you need it.
- However, if you have all the CSS code on another file, which should have the .css extension, then you need to add some code inside the head tags at the top of the html page.
- <link rel="stylesheet" type="text/css" href="CSSFILENAME.css">
- Be sure to replace 'CSSFILENAME' with the name of your stylesheet.(Also remember to add .css)
- After you are done you can just check your index html page if changes are applied when editing your CSS file.
Tips
- Be sure to always change the CSS file when adding new text formats to the html document.
- Always remember to have the CSS stylesheet as the extension .css