Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Proper order for settings to CSS border selector

Reply
Thread Tools

Proper order for settings to CSS border selector

 
 
joshbeall@gmail.com
Guest
Posts: n/a
 
      07-22-2006
Hi All,

I recently had someone look at a stylesheet I had written up, and they
gave me a slap on the hand for putting something like this:

div.someclass {
border: 1px red solid;
}

They said it was not the proper order. Fair enough, so I made it this:

div.someclass {
border: 1px solid red;
}

Which is, I'm told, the correct order.

However, I then heard from another miscellaneous site* that the order
doesn't matter.

So, who is correct? Can anyone point me to the relevant portion of the
specs that would say who is correct?

-jb


*Item number 3 from this page:
http://www.evolt.org/article/Ten_CSS...know/17/60369/

 
Reply With Quote
 
 
 
 
jojo
Guest
Posts: n/a
 
      07-22-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:

> I recently had someone look at a stylesheet I had written up, and they
> gave me a slap on the hand for putting something like this:
>
> div.someclass {
> border: 1px red solid;
> }
>
> They said it was not the proper order. Fair enough, so I made it this:
>
> div.someclass {
> border: 1px solid red;
> }
>
> Which is, I'm told, the correct order.
>
> However, I then heard from another miscellaneous site* that the order
> doesn't matter.
>
> So, who is correct? Can anyone point me to the relevant portion of the
> specs that would say who is correct?
>
> -jb
>
>
> *Item number 3 from this page:
> http://www.evolt.org/article/Ten_CSS...know/17/60369/
>


ASFAIK the order doesn't really matter. But specs (see:
http://www.w3.org/TR/REC-CSS2/propidx.html ) say that it has to be
'width' 'style' 'color'. But most browsers understand it every way
round, although that isn't correct. Is just the browsers doing you a
favor (but they don't need to!).
 
Reply With Quote
 
 
 
 
dorayme
Guest
Posts: n/a
 
      07-22-2006
In article <e9tvll$snu$(E-Mail Removed)>,
jojo <(E-Mail Removed)> wrote:

> ASFAIK the order doesn't really matter. But specs (see:
> http://www.w3.org/TR/REC-CSS2/propidx.html ) say that it has to be
> 'width' 'style' 'color'.


Does not say any such thing at your reference.

--
dorayme
 
Reply With Quote
 
jojo
Guest
Posts: n/a
 
      07-22-2006
dorayme wrote:
>
>> ASFAIK the order doesn't really matter. But specs (see:
>> http://www.w3.org/TR/REC-CSS2/propidx.html ) say that it has to be
>> 'width' 'style' 'color'.

>
> Does not say any such thing at your reference.
>


It does!

'border' [ 'border-width' || 'border-style' || <color> ]|inherit
 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      07-23-2006
In article <e9ucr4$bos$(E-Mail Removed)>,
jojo <(E-Mail Removed)> wrote:

> dorayme wrote:
> >
> >> ASFAIK the order doesn't really matter. But specs (see:
> >> http://www.w3.org/TR/REC-CSS2/propidx.html ) say that it has to be
> >> 'width' 'style' 'color'.

> >
> > Does not say any such thing at your reference.
> >

>
> It does!
>
> 'border' [ 'border-width' || 'border-style' || <color> ]|inherit


Ok, let me explain: to press your point home you need to give the
OP a reference to how this is to be read. Your reference, in
itself, does not contain any instructions as to whether the order
printed here is mandatory. You might think it obvious. It is not
obvious to me nor might it be to the OP. You need to reference
the meaning of "||" as well.

And just to make sure, let me comment on a possible thought you
are having. "Why would they print it in this order if they did
not mean it to be that way?" The answer is that there is no way
they can print an example or template without printing it in some
order.[1]

The point, again, is that you cannot always judge how something
is to be interpreted by staring at it. Take the word "zymotic" as
an example: staring at it will never reveal its meaning. If you
otherwise know its meaning, it will not impress a doubter by
referring her to the word itself.

[1] They could with javascript or php perhaps: have the order
keep changing every second and you get to see that it does not
matter. That would be a way it could show the order is not
important.

--
dorayme
 
Reply With Quote
 
mbstevens
Guest
Posts: n/a
 
      07-23-2006
On Sun, 23 Jul 2006 11:29:44 +1000, dorayme wrote:

> In article <e9ucr4$bos$(E-Mail Removed)>,
> jojo <(E-Mail Removed)> wrote:
>
>> dorayme wrote:
>> >
>> >> ASFAIK the order doesn't really matter. But specs (see:
>> >> http://www.w3.org/TR/REC-CSS2/propidx.html ) say that it has to be
>> >> 'width' 'style' 'color'.
>> >
>> > Does not say any such thing at your reference.
>> >

>>
>> It does!
>>
>> 'border' [ 'border-width' || 'border-style' || <color> ]|inherit

>
> Ok, let me explain: to press your point home you need to give the
> OP a reference to how this is to be read. Your reference, in
> itself, does not contain any instructions as to whether the order
> printed here is mandatory. You might think it obvious. It is not
> obvious to me nor might it be to the OP. You need to reference
> the meaning of "||" as well.


It was pretty well hidden, but I knew they had to have it somewhere:

http://www.w3.org/TR/REC-CSS2/about.html
...seems to have the necessary info for interpreting:
http://www.w3.org/TR/REC-CSS2/propidx.html

The most relevant section:
<quoting>
* Several juxtaposed words mean that all of them must occur,
in the given order.
* A bar (|) separates two or more alternatives:
exactly one of them must occur.
* A double bar (||) separates two or more options:
one or more of them must occur, in any order.
* Brackets ([ ]) are for grouping.
</quoting>






 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      07-23-2006
In article <(E-Mail Removed)> ,
mbstevens <(E-Mail Removed)> wrote:

> On Sun, 23 Jul 2006 11:29:44 +1000, dorayme wrote:
>
> > In article <e9ucr4$bos$(E-Mail Removed)>,
> > jojo <(E-Mail Removed)> wrote:
> >
> >> dorayme wrote:
> >> >
> >> >> ASFAIK the order doesn't really matter. But specs (see:
> >> >> http://www.w3.org/TR/REC-CSS2/propidx.html ) say that it has to be
> >> >> 'width' 'style' 'color'.
> >> >
> >> > Does not say any such thing at your reference.
> >> >
> >>
> >> It does!
> >>
> >> 'border' [ 'border-width' || 'border-style' || <color> ]|inherit

> >
> > Ok, let me explain: to press your point home you need to give the
> > OP a reference to how this is to be read. Your reference, in
> > itself, does not contain any instructions as to whether the order
> > printed here is mandatory. You might think it obvious. It is not
> > obvious to me nor might it be to the OP. You need to reference
> > the meaning of "||" as well.

>
> It was pretty well hidden, but I knew they had to have it somewhere:
>
> http://www.w3.org/TR/REC-CSS2/about.html
> ...seems to have the necessary info for interpreting:
> http://www.w3.org/TR/REC-CSS2/propidx.html
>
> The most relevant section:
> <quoting>
> * Several juxtaposed words mean that all of them must occur,
> in the given order.
> * A bar (|) separates two or more alternatives:
> exactly one of them must occur.
> * A double bar (||) separates two or more options:
> one or more of them must occur, in any order.
> * Brackets ([ ]) are for grouping.
> </quoting>


Yes, this seems to be definitive. As jojo implied, browsers seem
not to be bothered though... I tested in all my Mac browsers.

(Well found, mb...)

--
dorayme
 
Reply With Quote
 
jojo
Guest
Posts: n/a
 
      07-23-2006
dorayme wrote:

>>>>>> ASFAIK the order doesn't really matter. But specs (see:
>>>>>> http://www.w3.org/TR/REC-CSS2/propidx.html ) say that it has to be
>>>>>> 'width' 'style' 'color'.
>>>>> Does not say any such thing at your reference.
>>>>>
>>>> It does!
>>>>
>>>> 'border' [ 'border-width' || 'border-style' || <color> ]|inherit
>>>
>>> Ok, let me explain: to press your point home you need to give the
>>> OP a reference to how this is to be read. Your reference, in
>>> itself, does not contain any instructions as to whether the order
>>> printed here is mandatory. You might think it obvious. It is not
>>> obvious to me nor might it be to the OP. You need to reference
>>> the meaning of "||" as well.

>> It was pretty well hidden, but I knew they had to have it somewhere:
>>
>> http://www.w3.org/TR/REC-CSS2/about.html
>> ...seems to have the necessary info for interpreting:
>> http://www.w3.org/TR/REC-CSS2/propidx.html
>>
>> The most relevant section:
>> <quoting>
>> * Several juxtaposed words mean that all of them must occur,
>> in the given order
>> * A bar (|) separates two or more alternatives:
>> exactly one of them must occur.


Would have guessed so.

>> * A double bar (||) separates two or more options:
>> one or more of them must occur, in any order.


Oh, my apologies. I did not find the info how to interpret this. My
explanation for || would have been:

* A double bar (||) separates two or more options:
one or more of them must occur, in the given order.

>> * Brackets ([ ]) are for grouping.
>> </quoting>

>
> Yes, this seems to be definitive. As jojo implied, browsers seem
> not to be bothered though... I tested in all my Mac browsers.


And every browser on windows I have (Opera, Firefox, IE6) ignore the
order, too. Yes, even IE does it right...

>
> (Well found, mb...)
>

 
Reply With Quote
 
mbstevens
Guest
Posts: n/a
 
      07-23-2006
On Sun, 23 Jul 2006 13:35:06 +0200, jojo wrote:

>>> * A double bar (||) separates two or more options:
>>> one or more of them must occur, in any order.

>
> Oh, my apologies. I did not find the info how to interpret this. My
> explanation for || would have been:


Their use is not 'standard' here, either. In mathmatical logic
and in most (but clearly not all) computer languages it simply
means a test for inclusive-or with the truth table:

x T F T F

y F T T F

(x || y) T T T F




 
Reply With Quote
 
mbstevens
Guest
Posts: n/a
 
      07-23-2006
On Sun, 23 Jul 2006 12:47:06 +0000, mbstevens wrote:

> Their use is not 'standard' here, either. In mathmatical logic
> and in most (but clearly not all) computer languages it simply
> means a test for inclusive-or with the truth table:
>
> x T F T F
>
> y F T T F
>
> (x || y) T T T F


However, if we interpret being present to mean truth, their use actually
does fall in line with the standard use, since there is no requirement
for ordering in the standard use, either.

 
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
Settings.settings file with settings for multiple regions donet programmer ASP .Net 3 11-20-2009 03:05 PM
border-color: #003366; border-width: 2px; =?UTF-8?B?TWFydGluIFDDtnBwaW5n?= HTML 64 07-30-2006 04:01 PM
Drop Down List Border Width vs Text Box Border Width Coder ASP .Net 1 06-24-2006 01:27 PM
row bottom border in inner table not matching up with row border in outer table phl HTML 1 06-08-2006 03:43 PM
Datagrid Border showing when I say no border tshad ASP .Net 0 01-31-2005 05:40 PM



Advertisments