Visual Studio - CSS

by
Jeremy Canfield |
Updated: March 12 2020
| Visual Studio articles
Follow these directions to create the CSS folder and styles.css file.
- In Visual Studio, on the right (solution explorer) hover over the name of our site, right-click and select Add > New Folder
- Name the new folder CSS
- With the CSS folder highlighted press Ctrl + Shift + A (or right click and select Add > New Item)
- In the Add New Item pop-up box, select Style Sheet. Name the style sheet (ex. styles.css). Click Add.
- The top menu of Visual Studio should now have a styes.css tab.
For the purpose of this demonstration, add the following to the styles.css tab.
.text-style {
font-size: 16px;
color: #ddd;
font-weight: 600;
}
Follow these directions to apply the text-style CSS to some text on your site.
- On a page which you want to use CSS, add the following to the HEAD.
<link href="css/styles.css" rel="stylesheet" type="text/css" media="screen" />
- Add text-style to a div.
<div class="text-style">This is a test</div>
Did you find this article helpful?
If so, consider buying me a coffee over at