Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    Regular Coder
    Join Date
    Dec 2002
    Location
    France
    Posts
    522
    Thanks
    0
    Thanked 0 Times in 0 Posts

    border & percentage

    it seems that Internet explorer and Mozilla doesn't recognize

    border:1% solid #F6F7EB;

    it works fine for Opera


    do you know why ?

  • #2
    me'
    me' is offline
    Senior Coder
    Join Date
    Nov 2002
    Location
    Warwickshire, England
    Posts
    1,229
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Are you sure? It seems fine based on the CSS spec, although you have to be careful with percentages. Is it a vertical, horizontal or both borders that aren't recognised?
    David House - Perfect is achieved, not when there is nothing left to add, but when there is nothing left to take away. (Antoine de St. Exupery).
    W3Schools | XHTML Validator | CSS Validator | Colours | Typography | HTML&CSS FAQ | Go get Mozilla Now | I blog!

  • #3
    Regular Coder
    Join Date
    Dec 2002
    Location
    France
    Posts
    522
    Thanks
    0
    Thanked 0 Times in 0 Posts

    just try and see

    <?xml version="1.0" encoding="iso-8859-1"?>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" style="width:100%;height:100%;padding:0px;border:0px;margin:0px;">
    <head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
    <title>titre</title>
    </head>
    <body style="width:100%;height:100%;padding:0px;border:0px;margin:0px;background-color:ivory;">
    <form id="MainForm" style="width:100%;height:100%;">
    <div style="width:200px;height:100px;border:2% outset #990000;overflow:auto;text-align:center;padding:2%;background-color:tan;position:absolute;top:10%;left:15%;"> content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content </div>
    </form>
    </body>
    </html>


    this works perfectly for Opera , but not at all for Mozilla or IE .. the border of course

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Maybe one or two percent is computing to less than one pixel, although clearly it shouldn't. What happens if you try 10% - does that work?
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

  • #5
    Regular Coder
    Join Date
    Dec 2002
    Location
    France
    Posts
    522
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have looked in the w3c >>> CSS2
    and there is NO percentage for borders !!

    :-(((

    .....yes I have tried with border:20%;

    then it seems totally uncoherent if you want a box total width = 100% with a border !
    Last edited by angiras; 12-29-2003 at 08:25 AM.

  • #6
    me'
    me' is offline
    Senior Coder
    Join Date
    Nov 2002
    Location
    Warwickshire, England
    Posts
    1,229
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Really? I checked, and:
    <length>
    The border's thickness has an explicit value. Explicit border widths cannot be negative.
    [quote source]

    Doesn't say anything about percentages.
    David House - Perfect is achieved, not when there is nothing left to add, but when there is nothing left to take away. (Antoine de St. Exupery).
    W3Schools | XHTML Validator | CSS Validator | Colours | Typography | HTML&CSS FAQ | Go get Mozilla Now | I blog!

  • #7
    Regular Coder
    Join Date
    Dec 2002
    Location
    France
    Posts
    522
    Thanks
    0
    Thanked 0 Times in 0 Posts
    they say nothing because it doesn't work . look for padding and you will see >>> length or percentage

    I hope CSS3 will accept it

  • #8
    me'
    me' is offline
    Senior Coder
    Join Date
    Nov 2002
    Location
    Warwickshire, England
    Posts
    1,229
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yeah, it says you can have a length or a percentage for padding, meaning you can have a percentage.
    David House - Perfect is achieved, not when there is nothing left to add, but when there is nothing left to take away. (Antoine de St. Exupery).
    W3Schools | XHTML Validator | CSS Validator | Colours | Typography | HTML&CSS FAQ | Go get Mozilla Now | I blog!

  • #9
    Regular Coder
    Join Date
    Dec 2002
    Location
    France
    Posts
    522
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yes and you cannot for borders :-))

  • #10
    me'
    me' is offline
    Senior Coder
    Join Date
    Nov 2002
    Location
    Warwickshire, England
    Posts
    1,229
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Okay, I'm with you now!

    Wierd.
    David House - Perfect is achieved, not when there is nothing left to add, but when there is nothing left to take away. (Antoine de St. Exupery).
    W3Schools | XHTML Validator | CSS Validator | Colours | Typography | HTML&CSS FAQ | Go get Mozilla Now | I blog!

  • #11
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post
    I'm pretty sure that it's not CSS2 at least last I read the CSS2 data I noticed it didn't say anything about it like usual (as you stated).. I never use variable width borders myself but I don't see why they did not include it in the standard.

    Perhaps liorean will appear here shortly, he seems to know reasons behind most things..I'd like to know where he gets all his infos from though .
    Omnis mico antequam dominus Spookster!

  • #12
    Regular Coder
    Join Date
    Dec 2002
    Location
    France
    Posts
    522
    Thanks
    0
    Thanked 0 Times in 0 Posts
    it can be so practicle to write

    border:1% solid red;
    padding :0.1%;
    margin:1%;
    width:80%;

    if just the border doesn't want all fall down

  • #13
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post
    I hardly ever do anything beyond;

    border: solid 1px #2266AC /* random color */

    or

    boder: none; /* */

    I don't really see the use of a variable border width. Sure I could come up with a situation but fixed width is far more practical and theoretically would speed up load time (although that'd have to be one slow computer/browser combo!) ...
    Omnis mico antequam dominus Spookster!

  • #14
    Regular Coder
    Join Date
    Dec 2002
    Location
    France
    Posts
    522
    Thanks
    0
    Thanked 0 Times in 0 Posts
    then how do you fix a total box width = 100% , with a border ?


    in that way it works >>>

    border-width:1% solid red;
    padding :1%;
    margin:1%;
    width:97%;

  • #15
    me'
    me' is offline
    Senior Coder
    Join Date
    Nov 2002
    Location
    Warwickshire, England
    Posts
    1,229
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Don't set a width. The UA will calculate the correct width.

    The float model screws this up though.
    David House - Perfect is achieved, not when there is nothing left to add, but when there is nothing left to take away. (Antoine de St. Exupery).
    W3Schools | XHTML Validator | CSS Validator | Colours | Typography | HTML&CSS FAQ | Go get Mozilla Now | I blog!


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •