is this css legal ?

N

NoWhereMan

are these css selectors legal ?

..storycontent > p:first-child:first-letter{
font-size: 6em;
color: #bc0f09;
font-family: Georgia, Times, 'Times New Roman', serif;
float: left;
padding: 0.1em;
}

..storycontent > p:first-child:first-line{
font-variant: small-caps;
font-size: 1.3em;
}

looks like syntactically valid (the w3c validator says it is) but is it
legal ?

firefox interprets this as I suppose it should; opera does not :(


--
NoWhereMan
-- NoWhereBlog: www.nowhereland.it
-- deviantArt: http://nowhereland.deviantart.com
-- Giochi a BiteFight? http://bitefight.nowhereland.it/
-- Vagisil migliora la tua vita intima: www.vagisil.com/teencenter.shtml
 
H

Harlan Messinger

NoWhereMan said:
are these css selectors legal ?

.storycontent > p:first-child:first-letter{
font-size: 6em;
color: #bc0f09;
font-family: Georgia, Times, 'Times New Roman', serif;
float: left;
padding: 0.1em;
}

.storycontent > p:first-child:first-line{
font-variant: small-caps;
font-size: 1.3em;
}

looks like syntactically valid (the w3c validator says it is) but is it
legal ?

Why do you doubt the veracity of the W3C validator?
firefox interprets this as I suppose it should; opera does not :(

The W3C validator is a priori more reliable (because comprehensive) than
Opera.
 
E

Eric B. Bednarz

NoWhereMan said:
are these css selectors legal ?

.storycontent > p:first-child:first-letter{
.storycontent > p:first-child:first-line{
looks like syntactically valid (the w3c validator says it is) but is it
legal ?

It looks suspicious but formally correct.
firefox interprets this as I suppose it should; opera does not :(

The odds are that Opera does the right thing; you did not show the
markup, and probably not the complete style sheet.

So what's the value of P's first child's display property (hint)?
 
H

Harlan Messinger

Eric said:
It looks suspicious

Why? Because it's redundant?
> but formally correct.


The odds are that Opera does the right thing; you did not show the
markup, and probably not the complete style sheet.

So what's the value of P's first child's display property (hint)?

As with any of the pseudo-elements, it's pseudo. There isn't an element
there that has properties of its own, display or otherwise. Only if a
element specifier, to which a pseudo-element specifier is attached in a
selector, matches an element in the document does the UA act *as if*
there were an element possessing (only) the style properties that are
set. This is what happens in the case of

div.story:first-letter {
float: left;
font-size: 3em;
font-weight: bold;
}

At that point, the UA equally well act *as if* that pseudo-element has
pseudo-elements of its own, if a reference that could be interpreted
that way appear in a selector.
 
R

richard

NoWhereMan said:
are these css selectors legal ?

.storycontent > p:first-child:first-letter{
font-size: 6em;
color: #bc0f09;
font-family: Georgia, Times, 'Times New Roman', serif;
float: left;
padding: 0.1em;
}

.storycontent > p:first-child:first-line{
font-variant: small-caps;
font-size: 1.3em;
}

looks like syntactically valid (the w3c validator says it is) but is it
legal ?

firefox interprets this as I suppose it should; opera does not :(

What's with the > before p?
The only time > should be used is to denote a tag.
<tag></tag>
 
N

NoWhereMan

It looks suspicious but formally correct.


The odds are that Opera does the right thing; you did not show the
markup, and probably not the complete style sheet.

So what's the value of P's first child's display property (hint)?

you can see full page at the nowhereblog on my sign :)
 
N

NoWhereMan

Why do you doubt the veracity of the W3C validator?

well, I couldn't find anything about this in the css specs
The W3C validator is a priori more reliable (because comprehensive) than
Opera.

yes, but it's strange for a browser passing the acid test (even thought
that's not really a reliable test for standard-compliance) not working with
this; no probs, though, do you think I should file a bug to opera, then?
 
N

NoWhereMan

Why? Because it's redundant?

i used the first-child because if I used only the first-letter I would have
the big capital with every new <p>. You can see the markup at the
nowhereblog linked on my sign :)

[...]
At that point, the UA equally well act *as if* that pseudo-element has
pseudo-elements of its own, if a reference that could be interpreted
that way appear in a selector.

yes, that's what I thought when I used such a trick. however if you have a
suggestion for a (maybe) better solution just let me know. Css's are not
really my matter :)

bye
 
H

Harlan Messinger

Harlan said:
As with any of the pseudo-elements, it's pseudo.

Er--pseudo-class, and first-child really *does* refer to an element from
which properties hang, despite what I wrote below.
There isn't an element
there that has properties of its own, display or otherwise. Only if a
element specifier, to which a pseudo-element specifier is attached in a
selector, matches an element in the document does the UA act *as if*
there were an element possessing (only) the style properties that are
set. This is what happens in the case of
[...]
 
A

Andy Dingley

richard said:
What's with the > before p?

Check the posting profile and the trucking groups

Yes, it's Bullis The Stupid back again!


If you care, the ">" is called a child selector in CSS and it's in the
CSS spec. Not a huge amount of use as IE has issues with it, but it is
valid.
 
D

dorayme

firefox interprets this as I suppose it should; opera does not :(

The W3C validator is a priori more reliable (because comprehensive) than
Opera.[/QUOTE]

I think you want "prima facie" rather than "a priori"...
 
D

dorayme

"Beauregard T. Shagnasty said:
After all these years, aren't you being overly optimistic?

I saw AD as being evangelical... realistic optimism does not come
into it...

:)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top