How to add CSS autocomplete to eclipse
Solution 1
Go:
Window -> Preferences -> Web -> CSS files -> Editor -> Content assist.
And make sure the checkboxes are checked
EDIT: Ok... Then try with these:
Window -> Preferences -> General -> Content Types -> Text -> JSP -> Add (*.css)
OR
Window -> Preferences -> General -> Content Types -> Text -> Java Source File -> Add (*.css)
Try with these and see if it solves your problem
EDIT 2: Plus try this:
Window -> Preferences -> General -> Editors -> File Association -> Add (*.css)
EDIT 3:
Window -> Preferences -> General -> Editors -> File Association
make sure it looks like this, it works for me with the autocompletion:
Solution 2
You need to install a WTP extension plugin (WTP Web resources). See my answer here https://stackoverflow.com/a/43549935/2459094.
fresh_dev
Updated on July 09, 2022Comments
-
fresh_dev almost 2 years
i am using eclipse helios 3.6 and i am developing JSF pages (Dynamic Web Project With JSF Capabilities) and sometimes i need to add style to a component in the xhtml page
<h:commandLink style="margin-righ:10px">
(not a style class) and i want to add CSS autocomplete to eclipse how to do so ? please advise, thanks.
-
fresh_dev over 12 yearsin fact they are checked, maybe that works in css files only ?
-
fresh_dev over 12 yearsyou noticed that i asked for autocomplete in xhtml page not in css file ?
-
fresh_dev over 12 yearsdoesn't work either no css proposal, no css template proposal, no default proposal.
-
AndroidHustle over 12 yearsSorry I've been away. Ok, so it's a .JSP file containing xHTML right? Look at my edit.
-
fresh_dev over 12 yearsno it's a .xhtml file that contains JSF, and i tried to open it with JSP editor and also the web page editor, and nothing works, still there's no css autocomplete, maybe i am missing something in my project configuration ?
-
AndroidHustle over 12 yearsOk so you've opened it with IDE's other than Eclipse and the autocompletion doesn't work there either..? If so this sounds very strange to me.
-
fresh_dev over 12 yearsafter applying all above steps and restarting eclipse, i am getting this exception: stackoverflow.com/questions/7914131/… please advise
-
AndroidHustle over 12 yearshmm... there seems to be something really wrong with your environment configuration... this looks like an old bug that could appear in the IDE, that has been fixed, I can't see why you're getting it... I don't know honestly, re-install Eclipse? If that's not too great of an issue..?
-
AndroidHustle over 12 yearsAllright mate, I wish you the best of luck. Those guys roaming the Eclipse forum should be able to tell you what's wrong I'm sure!
-
fresh_dev over 12 yearsBTW, what eclipse version do you use ?
-
AndroidHustle over 12 yearsVersion: 3.6.2.r362_v20110210-9gF78Gs1FrIGnHDHWkEcopoN8AmxeZflGDGKQi Build id: M20110210-1200
-
AndroidHustle over 12 yearsSo it should be pretty much the same version as you're using
-
Atheist about 10 yearsWhat tripped me, was that I had to press ctrl-space to get the suggestion box, while in the php-editor it would pop up automatically.