How to use CSS is Visual Studio

Home > Search > How-to

Follow these directions to create the CSS folder and styles.css file.

  1. In Visual Studio, on the right (solution explorer) hover over the name of our site, right-click and select Add > New Folder
  2. Name the new folder CSS
  3. With the CSS folder highlighted press Ctrl + Shift + A (or right click and select Add > New Item)
  4. In the Add New Item pop-up box, select Style Sheet. Name the style sheet (ex. styles.css).  Click Add.
  5. 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.

  1. 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" />
  1. Add text-style to a div.
<div class="text-style">This is a test</div>


Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

Please enter in the box below so that we can be sure you are a human.