NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
phpEd reporting css attribute selectors with an error


Joined: 01 May 2009
Posts: 2
Reply with quote
I've noticed that phpEd is giving me an error indicator for the code below:

<style media="screen" type="text/css">
input[class^='txt_'] {
color: rgb(255,0,0);
}
</style>

It places a red line under the c in class with the message 'Uexpected character in input'

Its definately phpEd displaying this error as I've also checked the file with HTML Validator 9 Std and it reports that the file is valid, also the online CSS validator confirms it as valid.
View user's profileFind all posts by phucksteppSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
As far as I see CSS selector that you entered is not correct.
Probably you meant
input[class~='txt_'] {
instead of
input[class^='txt_'] {

and CSE would't find such errors, you're right

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 01 May 2009
Posts: 2
Reply with quote
The class~= indicator, I believe, is for matching a string in any part of the css selector:

a[href~="donkey"] - would match any a href link with the word donkey in it

others are:

a[href$="pdf"] - matchs an href that ENDS in pdf
a[href^="http://"] - matchs an href that STARTS with http://
a[href*="hello"] - matchs an href that has hello somewhere in it


View user's profileFind all posts by phucksteppSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
all those variants are defined in CSS v3 standard which is not widely supported these days.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 20 May 2009
Posts: 11
Location: Germany
Reply with quote
hmm .. in 2.1 we've:
Code:
[att]        - has attribute match
[att=val]    - exact match
[att~=val]   - word match
[att|=val]   - matches if attribute is "val" or starts with "val-"

http://www.w3.org/TR/CSS21/selector.html#attribute-selectors
all these are supported by phped.

further more
Code:
[att^=val] - start match
[att$=val] - end match
[att*=val] - wildcard match
(and many others)

are indeed css3 selectors
http://www.w3.org/TR/css3-selectors/#attribute-substrings

ie7 doesn't support it, ok.
so some webdevelopers may not know it, ok.
but we've ie8 now and ... and ... excuse me ? even firefox 1.5 did "[attr^=val]" -.-

arr ... k, later on.
but by the way - what about having the css 2.1 pseudo selectors in our code suggestion popup,
when we enter "#selector-xy" and press ":" ,
instead of suggesting html-tags (which is strange, because "tag:tag" makes no sense) ? ;O)

[edit]
and ... did you ever try to edit a css file with hacks in it, or humm ... look at this:
Code:
#foo, /* comment -> no error */
#bar
{
  | /* -> press [suggestion shortcut], attributes show up  */
}

#foo,
#bar /* comment -> error! */
{
 | /* -> press [suggestion shortcut], html-tags show up  */
}

i like phped to help me, even if the css isn't valid in its eyes.
by the way the example above is valid, according to jigsaw & the rfc. (whip me if im wrong =)
[/edit]

[edit 2]
IE7 supports all the selectors we're talking about...
http://www.google.com/search?q=css3+ie7
Looks like i'm stupid >.<
[/edit 2]
View user's profileFind all posts by AbroSend private messageVisit poster's website


Joined: 13 Nov 2008
Posts: 17
Reply with quote
Is there planned support for CSS3 in the future? I just found that this code doesn't get recognized either:

Code:
::selection {
  background-color: #E7EFD1;
  color: #222;
}

::-moz-selection {
  background-color: #E7EFD1;
  color: #222;
}
View user's profileFind all posts by Archon810Send private messageVisit poster's website
phpEd reporting css attribute selectors with an error
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic