4

How can I have the CSS auto-complete for classes feature in Sublime Text 2?

For example, I have included a CSS file in my HTML document

link rel="stylesheet" href="css/style.css"

In CSS I have this:

.container-primary {
    border: 1px solid #DDDDDD;
    float: left;
    font-size: 12px;
        height: 115px;
    line-height: 1.4;
    margin: 0 -1px -1px 0;
    padding: 10px;
    text-align: center;
    width: 800px;
}

How can I have the auto-complete for the CSS class when I applying the class in the HTML?

<div id="content" class="container-primary"></div>

Thanks.

user1995781
  • 19,085
  • 45
  • 135
  • 236
  • I'm not sure I understand exactly what you are asking. Are you talking about auto-completing CSS attributes and values? Or are you talking about auto-completing HTML? Or are you talking about snippets? – skube Nov 27 '13 at 16:16

2 Answers2

1

Sublime Text 2 doesn't have support for that out of the box. SublimeAllAutocomplete extends the default autocomplete to find matches in all open files.

soycharliente
  • 777
  • 2
  • 7
  • 26
  • This package does work, but it has an annoying issue: it doesn't complete hyphenated CSS classes (e.g. ".menu-item"). – Liran H Mar 04 '17 at 20:25
1

I already used all autocomplete in sublime but its not working well use this instead of all autocomplete its really working how you want here is link: https://packagecontrol.io/packages/CSS%20Extended%20Completions

it will awesome

Hassan
  • 356
  • 1
  • 5
  • 20