CSS: Goto Declaration

There is a new feature that allows navigate to CSS class or id selector declaration from CLASS or ID attribute of an HTML tag. When you go over a usage of  a class or id selector with mouse pointer and the CTRL key is hold, then the selector is change to a link. The link navigates to the declaration. 

The picture below displays the navigation from td tag in an HTML file to the CSS file, where the header_top class selector is defined.

When there are more declarations that fit the selector name, than a popup window is displayed, where you can select the file. The red (unrelated) mark means that there is no direct connection between the usage and the declaration.

As you can see the features works in HTML files and PHP as well.


I wonder which version of NetBeans you are using. I use the nightly built and it crashes everytime I try to follow the CSS Declaration.

Posted by Azizur Rahman on March 11, 2010 at 01:57 PM CET #

This is a greatly useful feature. It's so pleasant to see NetBeans is getting more and more comfortable for no-fancy everyday work. Keep up the good work!

Posted by DaveBowman on March 11, 2010 at 07:13 PM CET #

To Azizur:
I use my own build usually, but it's the same as continual build at http://bertram.netbeans.org/hudson/job/PHP-build/ . The php continual build is made from web-main repository. The nightly builds are done from main repository. So the features and fixes that were committed to the web-main are automatically ported to the main repository, when web-main build is not crashing. Unfortunately there was a infrastructure problem last two days and the changes from web-main wasn't ported to the main repository. It should be fixed.

Your exception doesn't have to be result of this. Could you report it in our bugzilla?

Posted by Petr Pisl on March 12, 2010 at 02:13 AM CET #

I know it's not the best place to ask, but I will do it either way (sorry! :) ).
How can I set xml syntax highlight for svg files? I tried setting xml mime type for svg file extension in options, but to no effect.

Posted by Azrael Valedhel on March 12, 2010 at 03:12 AM CET #

Also, I confirm the "CSS: Goto Declaration" working fine in build 201003040200. It actually is very nice in jumping through a bigger and bigger css file without using search. :)

Posted by Azrael Valedhel on March 12, 2010 at 06:05 AM CET #

Great productivity improvement, Thanks! At the end of the day, these workflow optimizations are what makes the difference between IDEs.

Posted by janogarcia on March 15, 2010 at 05:42 AM CET #


the last stable php build ist over 7 days old. Why?


Posted by Urkman on March 15, 2010 at 02:23 PM CET #

Hey Petr,

is the automated build site at http://bertram.netbeans.org/hudson/job/PHP-build/ currently down?

Posted by Ota Mares on March 16, 2010 at 03:57 AM CET #

Hi all,
I'm sorry for to be quite. I'm very busy with the fixing bug and rewriting the formatter.

The bertram is working at least for me now. There was done a bigger rewrite in the our php editor infrastructure and some tests are failing, we have to fix this asap. This is reason why the latest successful build is older than usually.

Posted by Petr Pisl on March 18, 2010 at 04:05 PM CET #

i'm using NetBeans IDE 6.8 (Build 200912091457).
This function is not working there.

Posted by Achim Fink on March 28, 2010 at 07:03 PM CEST #

Yes, this feature do not work in Netbeans 6.8, What's wrong?

Posted by ntpnhan on April 05, 2010 at 06:10 AM CEST #

Is there a way how to disable this new feature?

Posted by GeckoN on June 24, 2010 at 05:11 AM CEST #

This feature is available from NB 6.9.

@GeckoN: Why do you want to disable? You don't have to use it, if you don't want. It's not automatic, you have to invoke it.

Posted by Petr Pisl on June 24, 2010 at 06:31 AM CEST #

@Petr Pisl: Actualy, I want to disable only checking and coloring syntax by CSS in HTML in tags CLASS and ID for two reasons. I'm using my own color syntax and now it is hard to read with this. And the second reason is, I'm using template engine similar to Smarty and this code is marked as error.

Posted by GeckoN on June 24, 2010 at 07:36 AM CEST #

Finally found this post to wonder WHY that was happening. Everytime I would click on an selector it would change color and that was VERY annoying.

Does anyone know HOW to configure the COLOR for that link?

Posted by kkathman on August 28, 2010 at 09:05 PM CEST #

to kkathman and possible also to GeckoN:):

You can change the color in Tools->Options->Font & Colors tab ->Syntax -> select the language and there should be item Mark Occurrences.


Posted by Petr Pisl on September 08, 2010 at 08:18 AM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed

This blogs is written by NetBeans developers who contribute to the PHP support mainly.


« July 2016