Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to edit 'URL'. The style sheet must be part of the project

I have been getting this error in Visual Studio 2012 every time I try type an element and the class attribute (i.e. <div class="). It will popup and some times it even crashes Visual Studio if I hit enter too fast.

enter image description here

Is there anyway to get rid of this error while still getting the list of all the CSS classes?

like image 491
Jeremy Boyd Avatar asked May 06 '14 15:05

Jeremy Boyd


People also ask

How do you edit a style sheet?

You can edit or remove a stylesheet that's already attached by hovering over it and clicking Edit to make changes to it or the X to remove it. After adding a stylesheet, click Publish changes in the upper right-hand corner to apply your changes to the live pages(s) using the template.

How do I create a style sheet?

To create a cascading style sheetOpen an HTML file, and then use the <STYLE> tag to specify the font, color, margin, heading styles, and other style elements you want your style sheet to use. If you want to create an external style sheet and link other files to it, save the style sheet as a separate .

How do I create a custom CSS file in HTML?

CSS can be added to HTML documents in 3 ways: Inline - by using the style attribute inside HTML elements. Internal - by using a <style> element in the <head> section. External - by using a <link> element to link to an external CSS file.


1 Answers

I was having the same problem and a little search brought me to the following page:

http://forums.asp.net/t/1586914.aspx?Unable+to+edit+CSS+file+

In a nutshell: Add a fake parameter to the end of your CDN URL to get rid of your errors. This also makes intellisense work correctly.

Example:

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css?parameter=1" rel="stylesheet">
like image 68
Ayrab Avatar answered Oct 22 '22 06:10

Ayrab