|
-
May 27th, 2002, 11:49 AM
#1
Thread Starter
Frenzied Member
Market Share != Quality
Have a look at the following page in your favorite web browser.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<head>
<title>Market Share != Quality</title>
</head>
<body>
<div style="position: relative;">
<p style="float: left;">If this sentence</p>
<p style="float: right;">makes sense, then your browser may work correctly. If this sentence is</p>
</div>
<div>
<p>jumbled, then your browser has failed.</p>
</div>
</body>
While there may be some unorthidox spacing, you should be able to read "If this sentence makes sense, then your browser may work correctly. If this sentence is jumbled, then your browser has failed." Am I right?
If so, IE 6 and Opera 6 failed. Mozilla 1.0 RC3 seems to understand it just fine.
Anyone have an ugly solution that doesn't involve tables for inept browsers?
Last edited by CiberTHuG; May 27th, 2002 at 12:01 PM.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
May 27th, 2002, 02:25 PM
#2
Frenzied Member
What effect are you try to get? I'm not sure how it looks in Moz because I recently formatted and haven't installed it yet, but this seems to look the same on NS 6.2, Opera 6.02, IE 6:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Market Share != Quality</title>
</head>
<body>
<div style="position: relative;">
<p style="float:left;">If this sentence</p>
<p style="float:right;">makes sense, then your browser may work correctly. If this sentence is</p>
</div>
<div style="clear:both;">
<p>jumbled, then your browser has failed.</p>
</div>
</body>
</html>
-
May 27th, 2002, 03:14 PM
#3
Thread Starter
Frenzied Member
Okay, adding the "clear" gets the affect I want. But... should I have to do that? I think not, since the second div is a sibling, not a child, of the first.
How about this:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<head>
<title>Market Share != Quality</title>
</head>
<body>
<div style="position: relative; border-style: solid;">
<p style="float: left;">If this sentence</p>
<p style="float: right;">makes sense, then your browser may work correctly. If this sentence is</p>
</div>
<div style="clear: both;">
<p>jumbled, then your browser has failed.</p>
</div>
</body>
Should there be a border around the first div, or above the first div, or between the floated text?
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
May 27th, 2002, 04:37 PM
#4
Frenzied Member
To my knowledge you should have to put clear, as float floats the object, even if it overlaps other elements. Like of you do something like:
Code:
<p><img src="SomeImage.png" alt="" style="float:left;">Here is some text</p>
<p>This text should wrap around the above image</p>
<p style="clear:left;">And this text shouldn't</p>
As for the second question, there should only be a border around the first div, and I think it should go through the images if they are bigger than the div. Is that border code valid CSS? Shouldn't it be something like "border: 1px solid black;"? I could be wrong about that though.
-
May 28th, 2002, 06:08 AM
#5
Thread Starter
Frenzied Member
But the third paragraph is not in the same block as the two that are floating. So why should it have to clear? It should be to the left inside its own block.
The example you give is three inline tags all in the same block. I have two seperate blocks.
If the border is supposed to actually go around the first div, then again, it is only correct in Mozilla.
Yes, the CSS is correct. The sample you gave for that is shorthand, which is correct, and can be expanded to "border-width: 1px; border-style: solid; border-color: black;".
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
May 28th, 2002, 07:53 AM
#6
Frenzied Member
I think it should have to clear, because like I said float will overlap other elements, even if they are not in the same block. I think there is a diagram on the W3C site somewhere, but I have no idea where 
I didn't know if you could have only border-style, I though maybe you would then need color and width also.
-
May 28th, 2002, 02:25 PM
#7
Thread Starter
Frenzied Member
There are some default values. I think width is 2px, or something close to that (1.8?) and color is black. And that may vary on UA. But default style is none. 'Course, the space should still be allocated.
I'd like to see that diagram. I'll have to look again. I think that it underminds the point of block level entities. Again, Mozilla has been more true than any other browser, so I'm siding with it simply based on track history.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
May 28th, 2002, 05:17 PM
#8
Frenzied Member
-
May 29th, 2002, 08:43 AM
#9
Thread Starter
Frenzied Member
UA is user agent. The web browser is a UA. Some browsers may have limitations imposed by the media they are on. If you had a visual browser with an LCD screen, then borders might always be 1, and never anything more.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
May 29th, 2002, 08:53 AM
#10
Frenzied Member
I don't know why I didn't think of user agent
-
May 29th, 2002, 09:03 AM
#11
Thread Starter
Frenzied Member
Okay, so I did some checking.
Yes, a floating object that overflows its containing block may obscure the border of other box blocks and affect the layout of their line blocks.
IE was doing that correctly.
If not explicitly defined, the height of a box block is determined by a number of things (spelled out in section 10.6 of the CSS2 documentation). In this case, the box blocks height is equal to the line- hieight of a contained line box.
IE failed to set the height of the box block, which allowed the floated object (a line box) to overflow and affect the following box.
I guess if I set the hieght of the box to 1em, then it would fix the problem and not require the float: clear.
I don't guess that is a huge problem. The lesson for today is, explicitly declare everything, because not everyone knows the correct way to comput them.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|