![]() | |
![]() |
| | Thread Tools | Display Modes |
#21
| |||
| |||
|
|
ironcorona wrote: HTML rule: inline elements (and a couple of block elements like h1 and p) can't hold block elements. CSS practice: assign inline or block to any block or inline element and get away with it ;-) Okay, I think I'm with you now. I assumed that if you had something like p><span></span></p and you set span {display:block;} that the browser would treat it exactly as if it were something like p><div></div></p and thus illegal because <p> contains a block element. But that's not how it works? Indeed :-) |
#22
| |||
| |||
|
|
ironcorona wrote: Els wrote: so I think maybe Firefox is assuming a missing </h1> tag and then putting the span on the next line (because <h1> is block). No, in HTML, <span> is inline, so there is no </h1> missing. But didn't you just set #Header span {display: block; float: right;} or am I not keeping up? That is CSS. You assign display:block to an inline element. A browser will only assume closing tags missing if the HTML is wrong. HTML rule: inline elements (and a couple of block elements like h1 and p) can't hold block elements. CSS practice: assign inline or block to any block or inline element and get away with it ;-) [snip] Not correct according to the CSS2.1 specs afaics, and it seems only Opera gets it right. (that is, of the 3 browsers I tested it in) Damned Opera and their sticking to the standard ![]() g |
#23
| |||
| |||
|
|
Els wrote: ironcorona wrote: Els wrote: so I think maybe Firefox is assuming a missing </h1> tag and then putting the span on the next line (because <h1> is block). No, in HTML, <span> is inline, so there is no </h1> missing. But didn't you just set #Header span {display: block; float: right;} or am I not keeping up? That is CSS. You assign display:block to an inline element. A browser will only assume closing tags missing if the HTML is wrong. HTML rule: inline elements (and a couple of block elements like h1 and p) can't hold block elements. CSS practice: assign inline or block to any block or inline element and get away with it ;-) [snip] Not correct according to the CSS2.1 specs afaics, and it seems only Opera gets it right. (that is, of the 3 browsers I tested it in) Damned Opera and their sticking to the standard ![]() g My experience is somewhat different to these observations. I am using IE, Firefox and Opera (as Opera) The reason that the floated h2 is not on the same line as h1 (as in h1><h2 style="float:right;">right text</h2>left text</h1> seems to have |
|
to do with cumulating margins. Declaring margin-top:0 on <h2> renders |
|
the two texts on the same line in all browsers. |
#24
| |||
| |||
|
|
boclair wrote: Els wrote: ironcorona wrote: Els wrote: Eh... <h2> inside <h1> ?? That's like... illegal :-) |
|
I'll assume you meant our example of <h1>left text <span style="float:right;">right text</span></h1 You've put the floated block before the rest of the text. That works. |
|
Our investigated example had the right floated text after the regular text inside a <h1>. |
#25
| |||
| |||
|
#26
| |||
| |||
|
|
- the text in the 'banner' ('left-aligned txt/right-aligned text') appears to be 'cut-off' at the top and botton edges. This displays correctly in Firefox & Opera. |
|
- The menu at the left encroaches the banner box - it's too high. |
#27
| |||
| |||
|
|
You can remove the absolute padding from #Menu unless you need it for some other reason. Put the <div id="menu"> before <div id="content" and set both divs to float:left; In order for the two divs to line up side by side you have to give them width values [because the default is 100% of the screen size] I suggest setting #Content {width:77%; padding:2%;} and #Menu {width:16%; padding:1%;} [though you may need to jigger this around to suit your own needs], all of which adds up to 99% [remember that padding applies to both sides so in the case of #Content the 2% padding is 4% overall. Taking into account padding-left and padding-right] because there's issues with rounding or something that doesn't allow 100%. |
#28
| |||
| |||
|
#29
| |||
| |||
|
|
One thing I wondered about relating to the line-height thing; Is there any stated behaviour which should occur if the line-height is less than the font-size? |
![]() |
| Thread Tools | |
| Display Modes | |
| |