border:none; Is that wrong?

Discussion in 'HTML' started by Tim W, Sep 15, 2012.

  1. Tim W

    Tim W Guest

    Editing my css and want no border on a certain element so change what
    was the shorthand border declaration to
    border:none;
    which seems to work.

    But looking in my manual of css it seems to say I ought to have it
    border-style: none;
    But is that the same thing, the first option being the shorthand
    declaration with all the values missing except border-style?

    Or should it be just deleted, no declaration = no border

    All three options seem to work. Does it matter which one I use?

    Tim w
    Tim W, Sep 15, 2012
    #1
    1. Advertising

  2. Tim W

    Neil Gould Guest

    Tim W wrote:
    > Editing my css and want no border on a certain element so change what
    > was the shorthand border declaration to
    > border:none;
    > which seems to work.
    >
    > But looking in my manual of css it seems to say I ought to have it
    > border-style: none;
    > But is that the same thing, the first option being the shorthand
    > declaration with all the values missing except border-style?
    >
    > Or should it be just deleted, no declaration = no border
    >
    > All three options seem to work. Does it matter which one I use?
    >
    > Tim w
    >

    CSS2 specs border-style: none;, as the correct usage.

    --
    best regards,

    Neil
    Neil Gould, Sep 15, 2012
    #2
    1. Advertising

  3. 2012-09-15 14:00, Tim W wrote:

    > Editing my css and want no border on a certain element so change what
    > was the shorthand border declaration to
    > border:none;
    > which seems to work.


    No wonder. It's correct. You can also remove the border by not setting
    border properties at all, provided that you don't have a CSS rule
    somewhere that sets a border on the element. Theoretically, browser
    default style sheets might have such a rule (I don't think any of them
    has, except for images inside links), so setting border: none explicitly
    could be seen as extra safe.

    > But looking in my manual of css it seems to say I ought to have it
    > border-style: none;


    Does it, really?

    > But is that the same thing,


    Not at all, though they have partly the same effect, and depending on
    circumstances, the difference need not have a visible impact.

    > the first option being the shorthand
    > declaration with all the values missing except border-style?


    It's a shorthand notation, yes, but the values are missing in one sense
    only: the values are not written in the rule. The rule still sets all
    border properties, namely to initial values, unless explicitly
    specified. See
    http://www.w3.org/TR/CSS2/box.html#border-shorthand-properties

    Specifically, border: none is by definition equivalent to the following:

    border-width: medium;
    border-style: none;
    border-color: currentColor;

    where currentColor is to be replaced by the color of the content of the
    element (its color property value).

    For most practical purposes, border: none and border-style: none have
    the same effect, as the width and color of a nonexistent border do no
    matter. But in complicated situations, the difference may matter.
    Consider this:

    td { border: solid red; }
    td.foo { border: none; }
    td.bar { border-style: dashed; }

    What happens to <td class="foo bar">? It gets a dashed border of the
    color of the element content, black by default. The reason is that
    border: none sets the border color, too. If you had used border-style:
    none instead, then the border would be dashed red.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Jukka K. Korpela, Sep 15, 2012
    #3
  4. Tim W

    Hot-Text Guest

    "Tim W" <> wrote in message news:k31n37$tbr$...
    > Editing my css and want no border on a certain element so change what
    > was the shorthand border declaration to
    > border:none;
    > which seems to work.
    >
    > But looking in my manual of css it seems to say I ought to have it
    > border-style: none;
    > But is that the same thing, the first option being the shorthand
    > declaration with all the values missing except border-style?
    >
    > Or should it be just deleted, no declaration = no border
    >
    > All three options seem to work. Does it matter which one I use?
    >
    > Tim w



    table {
    border-style: none;
    border-bottom-style: none;
    border-left-style: none;
    border-right-style: none;
    border-top-style: none;
    }

    table {
    border-style: none;
    border-bottom: none;
    border-left: none;
    border-right: none;
    border-top: none;
    }

    my.table {
    border-style: none;
    border-bottom-style: none;
    border-left-style: none;
    border-right-style: none;
    border-top-style: none;
    }

    your.table {
    border-style: none;
    border-bottom: none;
    border-left: none;
    border-right: none;
    border-top: none;
    }
    Hot-Text, Sep 17, 2012
    #4
  5. Tim W

    Tim W Guest

    On 17/09/2012 06:02, Hot-Text wrote:

    >
    > table {
    > border-style: none;
    > border-bottom-style: none; border-left-style: none; border-right-style:
    > none; border-top-style: none;
    > }
    >
    > table {
    > border-style: none;
    > border-bottom: none; border-left: none; border-right: none; border-top:
    > none;
    > }
    >
    > my.table {
    > border-style: none;
    > border-bottom-style: none; border-left-style: none; border-right-style:
    > none; border-top-style: none;
    > }
    >
    > your.table {
    > border-style: none;
    > border-bottom: none; border-left: none; border-right: none; border-top:
    > none;
    > }
    >

    It is beautiful in its way in its plainess, its rythm and repetition.
    Its refusal to make any statement of meaning or give any clue to its
    inspiration makes it like a chant in a language not understood on which
    we can't help but overlay the work of our own imagination, drawn out by
    the effort of concentration on poem which is so reluctant to speak. Like
    Meditation or like true religion:

    "Written not with ink, but with the Spirit of the living God; not in
    tables of stone, but in fleshy tables of the heart."

    Tim W
    Tim W, Sep 17, 2012
    #5
  6. Tim W

    Hot-Text Guest

    "Tim W" <> wrote in message news:k36qfg$gjc$...
    > On 17/09/2012 06:02, Hot-Text wrote:
    >
    >>
    >> table {
    >> border-style: none;
    >> border-bottom-style: none; border-left-style: none; border-right-style:
    >> none; border-top-style: none;
    >> }
    >>
    >> table {
    >> border-style: none;
    >> border-bottom: none; border-left: none; border-right: none; border-top:
    >> none;
    >> }
    >>
    >> my.table {
    >> border-style: none;
    >> border-bottom-style: none; border-left-style: none; border-right-style:
    >> none; border-top-style: none;
    >> }
    >>
    >> your.table {
    >> border-style: none;
    >> border-bottom: none; border-left: none; border-right: none; border-top:
    >> none;
    >> }
    >>

    > It is beautiful in its way in its plainess, its rythm and repetition.
    > Its refusal to make any statement of meaning or give any clue to its
    > inspiration makes it like a chant in a language not understood on which
    > we can't help but overlay the work of our own imagination, drawn out by
    > the effort of concentration on poem which is so reluctant to speak. Like
    > Meditation or like true religion:
    >
    > "Written not with ink, but with the Spirit of the living God; not in
    > tables of stone, but in fleshy tables of the heart."
    >


    Mr. Tim W
    A True belief,
    A Stone can be broking,
    But the Heart will Heal...
    Hot-Text, Sep 18, 2012
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Freeman
    Replies:
    8
    Views:
    7,619
    tcena9
    Feb 16, 2011
  2. length power
    Replies:
    2
    Views:
    68
    Rustom Mody
    Apr 10, 2014
  3. Skip Montanaro
    Replies:
    0
    Views:
    50
    Skip Montanaro
    Apr 10, 2014
  4. Johannes Schneider

    Re: why i have the output of [None, None, None]

    Johannes Schneider, Apr 10, 2014, in forum: Python
    Replies:
    0
    Views:
    44
    Johannes Schneider
    Apr 10, 2014
  5. Terry Reedy
    Replies:
    0
    Views:
    54
    Terry Reedy
    Apr 10, 2014
Loading...

Share This Page