Go To Definition for CSS

Keyboard:  F12
Command:  Edit.GoToDefinition
Versions:  2008,2010
Published:  12/24/2010
Code:  vstipFind0021


Work with SharePoint?  Then make sure to check out the new SharePoint Developer Team Blog!


For those that are familiar with using "Go To Definition" in your code may not be aware that you can use the same technique on for class attributes to go to your CSS definition.  It couldn't be easier.  Just put your cursor inside the class name:




Then press F12 (or RIGHT CLICK and choose "Go To Definition").  It will instantly take you to the CSS definition and highlight it:



Now you can make edits, etc.. as you see fit.

Comments (4)

  1. Mark says:

    I've never known this to work! I just get an error dialog saying "Could not find CSS class selector '<selector>'"

  2. quachnguyen says:

    have you reference your css link into your markup file? (in default.aspx for example)

  3. zainnab says:

    Hey Mark,

    Quachnguyen asked a good question.  Without the reference this won't work.  I double-checked this recently for the book and it does work.  I would try just creating a very simple project with a CSS reference and a basic CSS file with only one entry.  See if that shows it working.

  4. This is useless says:

    If you use a style sheet that is in a master page or MVC SysLayout it does not work. Someone at Microsoft needs to re-visit this functionality and make it compatible with mater pages and SysLayout.

Skip to main content