Search code examples
htmlcsswebstorm

Autocompletion of ID's in sperate CSS-file in WebStorm 7?


I just started working with WebStorm 7 for the first time and I'm currently creating a simple HTML/CSS website. To begin with, I wrote my CSS inside the HTML file by using the style tag, but now I decided to put it in a separate file.

Auto completion is enabled, and it works with all html and css syntax, but now there is no auto completion when it comes to ID's (probably all custom names) in my CSS-class.

I have this in my HTML:

<div id="my_div">
</div>

Now, if I go to my CSS-file and type:div#my I'm expecting "my_div" to show up in a completion-list, but it does not. The CSS file is working with HTML, the result is just how I want it to be, I just have a problem with the auto completion.

What's strange is that after referring to an ID once in my CSS, it shows up for auto completion if I reference it again, but that doesn't really help seeing that most of the ID's only will be referenced once.

This did work while writing CSS inside the <style> tag, so I see no reason why it shouldn't work in a seperate file?

Thanks


Solution

  • Completion for CSS selectors works 'from CSS to HTML' and not vice versa: when editinhg HTML, you will see the list of all selectors defined in CSS files, but selectors written in HTML won't be available when editing CSS. See http://youtrack.jetbrains.com/issue/WEB-150