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.

1
  • 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? Commented Nov 27, 2013 at 16:16

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

This package does work, but it has an annoying issue: it doesn't complete hyphenated CSS classes (e.g. ".menu-item").
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

1 Comment

This package works really well Hassan, thank you very much for this suggestion!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.