Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > is this css legal ?

Reply
Thread Tools

is this css legal ?

 
 
NoWhereMan
Guest
Posts: n/a
 
      10-06-2006
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
 
Reply With Quote
 
 
 
 
Harlan Messinger
Guest
Posts: n/a
 
      10-06-2006
NoWhereMan wrote:
> 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.
 
Reply With Quote
 
 
 
 
Eric B. Bednarz
Guest
Posts: n/a
 
      10-06-2006
NoWhereMan <(E-Mail Removed)> writes:

> 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)?


--
||| hexadecimal EBB
o-o decimal 3771
--oOo--( )--oOo-- octal 7273
205 goodbye binary 111010111011
 
Reply With Quote
 
Harlan Messinger
Guest
Posts: n/a
 
      10-06-2006
Eric B. Bednarz wrote:
> NoWhereMan <(E-Mail Removed)> writes:
>
>> 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


Why? Because it's redundant?

> 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)?
>


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.
 
Reply With Quote
 
richard
Guest
Posts: n/a
 
      10-06-2006

"NoWhereMan" <(E-Mail Removed)> wrote in message
news:1jysbvn2ek2zn.1xm11nkjtugck$(E-Mail Removed).. .
> 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>

 
Reply With Quote
 
NoWhereMan
Guest
Posts: n/a
 
      10-06-2006
on Fri, 06 Oct 2006 20:43:27 +0200, Eric B. Bednarz wrote:

>> 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)?


you can see full page at the nowhereblog on my sign

--
NoWhereMan
-- NoWhereBlog: www.nowhereland.it
-- deviantArt: http://nowhereland.deviantart.com
 
Reply With Quote
 
NoWhereMan
Guest
Posts: n/a
 
      10-06-2006
on Fri, 06 Oct 2006 14:02:47 -0400, Harlan Messinger wrote:

> Why do you doubt the veracity of the W3C validator?


well, I couldn't find anything about this in the css specs

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

>
> 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?

--
NoWhereMan
-- NoWhereBlog: www.nowhereland.it
-- deviantArt: http://nowhereland.deviantart.com
 
Reply With Quote
 
NoWhereMan
Guest
Posts: n/a
 
      10-06-2006
on Fri, 06 Oct 2006 15:05:20 -0400, Harlan Messinger wrote:

> Eric B. Bednarz wrote:
>> NoWhereMan <(E-Mail Removed)> writes:
>>
>>> 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

>
> 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

--
NoWhereMan
-- NoWhereBlog: www.nowhereland.it
-- deviantArt: http://nowhereland.deviantart.com
 
Reply With Quote
 
David Dorward
Guest
Posts: n/a
 
      10-06-2006
richard wrote:

> What's with the > before p?


http://www.w3.org/TR/CSS2/selector.html#child-selectors

> The only time > should be used is to denote a tag.


Rubbish.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
 
Reply With Quote
 
Harlan Messinger
Guest
Posts: n/a
 
      10-06-2006
Harlan Messinger wrote:

> 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
> [...]

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS Layout question - how to duplicate a table layout with CSS Eric ASP .Net 4 12-24-2004 04:54 PM
confused - html validates, css validates but validate css from the html causes errors Titus A Ducksass - AKA broken-record HTML 6 11-15-2004 12:59 PM
Set CSS property equal to another CSS property? Noozer HTML 10 10-13-2004 09:20 PM
Is there a way to set the a CSS property to be explicitly the same as another CSS property? Joshua Beall HTML 1 12-10-2003 07:21 PM
print.css and screen.css tom watson HTML 1 09-09-2003 02:48 PM



Advertisments