Enjoy an ad free experience by logging in. Not a member yet?
Register .
12-24-2003, 05:00 PM
PM User |
#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 ?
12-24-2003, 07:00 PM
PM User |
#2
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?
12-24-2003, 07:31 PM
PM User |
#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
12-28-2003, 11:59 PM
PM User |
#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
12-29-2003, 07:22 AM
PM User |
#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 07:25 AM ..
12-29-2003, 10:09 AM
PM User |
#6
Senior Coder
Join Date: Nov 2002
Location: Warwickshire, England
Posts: 1,229
Thanks: 0
Thanked 0 Times in 0 Posts
Really? I checked, and:
Quote:
<length>
The border's thickness has an explicit value. Explicit border widths cannot be negative.
[
quote source ]
Doesn't say anything about percentages.
12-29-2003, 10:17 AM
PM User |
#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
12-29-2003, 10:19 AM
PM User |
#8
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.
12-29-2003, 10:27 AM
PM User |
#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 :-))
12-29-2003, 10:46 AM
PM User |
#10
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.
12-29-2003, 01:59 PM
PM User |
#11
Senior Coder
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-29-2003, 02:10 PM
PM User |
#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
12-29-2003, 02:17 PM
PM User |
#13
Senior Coder
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!
12-29-2003, 02:34 PM
PM User |
#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%;
12-29-2003, 02:35 PM
PM User |
#15
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.
Jump To Top of Thread
Thread Tools
Rate This Thread
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
All times are GMT +1. The time now is 08:18 PM .
Advertisement
Log in to turn off these ads.