次の方法で共有


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:

image

 

 

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

image

 

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

Comments

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

  • Anonymous
    December 26, 2010
    have you reference your css link into your markup file? (in default.aspx for example)

  • Anonymous
    January 03, 2011
    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.

  • Anonymous
    September 24, 2013
    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.