|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
And lo on Tue, 06 Nov 2007 15:59:06 -0000, Invisible <voi### [at] devnull> did
spake, saying:
> I have the following HTML:
>
> <span>A<span>B<span>C</span>D</span>E</span>
>
> I've set up some CSS to put borders round span elements. It's supposed
> to display as follows:
>
> +---------+
> | +-----+ |
> | | +-+ | |
> |A|B|C|D|E|
> | | +-+ | |
> | +-----+ |
> +---------+
>
> However, no matter what I do, it actually renders like this:
>
> +-+-+-+-+-+-+
> |A|B|C|D|E|F|
> +-+-+-+-+-+-+
>
> Any idea how I fix this?
What's wrong with this?
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<style>
span.outer {border: red 1px solid; padding: 20px;}
span.inner {border: red 1px solid; padding: 10px;}
span.centre {border: red 1px solid; padding: 0px;}
</style>
<span class="outer">A<span class="inner">B<span
class="centre">C</span>D</span>E</span>
</html>
--
Phil Cook
--
I once tried to be apathetic, but I just couldn't be bothered
http://flipc.blogspot.com
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
And lo on Tue, 06 Nov 2007 15:59:06 -0000, Invisible <voi### [at] devnull> did
spake, saying:
> I have the following HTML:
>
> <span>A<span>B<span>C</span>D</span>E</span>
>
> I've set up some CSS to put borders round span elements. It's supposed
> to display as follows:
>
> +---------+
> | +-----+ |
> | | +-+ | |
> |A|B|C|D|E|
> | | +-+ | |
> | +-----+ |
> +---------+
>
> However, no matter what I do, it actually renders like this:
>
> +-+-+-+-+-+-+
> |A|B|C|D|E|F|
> +-+-+-+-+-+-+
>
> Any idea how I fix this?
What's wrong with this?
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<style>
span.outer {border: red 1px solid; padding: 20px;}
span.inner {border: red 1px solid; padding: 10px;}
span.centre {border: red 1px solid; padding: 0px;}
</style>
<span class="outer">A<span class="inner">B<span
class="centre">C</span>D</span>E</span>
</html>
--
Phil Cook
--
I once tried to be apathetic, but I just couldn't be bothered
http://flipc.blogspot.com
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Phil Cook wrote:
> What's wrong with this?
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
> "http://www.w3.org/TR/html4/strict.dtd">
> <html>
> <style>
> span.outer {border: red 1px solid; padding: 20px;}
> span.inner {border: red 1px solid; padding: 10px;}
> span.centre {border: red 1px solid; padding: 0px;}
>
> </style>
> <span class="outer">A<span class="inner">B<span
> class="centre">C</span>D</span>E</span>
> </html>
Apart from there being an echo in here, that only allows a fixed amount
of nesting. I want to allow arbitrary nesting.
(This is basically for printing out expressions containing insane
numbers of brackets. I want to use borders to help untangle the mess in
some kind of visually-sane way...)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Try making it using the table tools in google docs. THEN look at the HTML
they come up with.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> Try making it using the table tools in google docs. THEN look at the HTML
> they come up with.
Tables would be overkill and *wrong* for this.
http://www.hotdesign.com/seybold/
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
And lo on Tue, 06 Nov 2007 18:21:42 -0000, Orchid XP v7 <voi### [at] devnull>
did spake, saying:
> Phil Cook wrote:
>
>> What's wrong with this?
>> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
>> "http://www.w3.org/TR/html4/strict.dtd">
>> <html>
>> <style>
>> span.outer {border: red 1px solid; padding: 20px;}
>> span.inner {border: red 1px solid; padding: 10px;}
>> span.centre {border: red 1px solid; padding: 0px;}
>> </style>
>> <span class="outer">A<span class="inner">B<span
>> class="centre">C</span>D</span>E</span>
>> </html>
>
> Apart from there being an echo in here,
I saw spans used that you said produced a fixed height block, I saw divs
used with and without floats; I didn't see this suggestion.
> that only allows a fixed amount of nesting. I want to allow arbitrary
> nesting.
Which you didn't mention.
> (This is basically for printing out expressions containing insane
> numbers of brackets. I want to use borders to help untangle the mess i
n
> some kind of visually-sane way...)
count the number of brackets and times by two then set the padding that
way so
(A(B(C)D)E) is 6 then replace every ( with a padding=n-(i*2) i++
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<style>
span {border: red 1px solid;}
</style>
<span style="padding:6px">A
<span style="padding:4px">B
<span style="padding:2px">C
</span>
D</span>
E</span>
</html>
I'm sure you can get one of the languages you use to do something like
that.
--
Phil Cook
--
I once tried to be apathetic, but I just couldn't be bothered
http://flipc.blogspot.com
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Phil Cook wrote:
> And lo on Tue, 06 Nov 2007 18:21:42 -0000, Orchid XP v7 <voi### [at] devnull>
> did spake, saying:
>
>> that only allows a fixed amount of nesting. I want to allow arbitrary
>> nesting.
>
> Which you didn't mention.
Oh alright then. ;-)
>> (This is basically for printing out expressions containing insane
>> numbers of brackets. I want to use borders to help untangle the mess
>> in some kind of visually-sane way...)
>
> count the number of brackets and times by two then set the padding that
> way so
>
> (A(B(C)D)E) is 6 then replace every ( with a padding=n-(i*2) i++
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
> "http://www.w3.org/TR/html4/strict.dtd">
> <html>
> <style>
> span {border: red 1px solid;}
> </style>
> <span style="padding:6px">A
> <span style="padding:4px">B
> <span style="padding:2px">C
> </span>
> D</span>
> E</span>
> </html>
>
> I'm sure you can get one of the languages you use to do something like
> that.
Well, that'll work... but surely there's some W3C compliant way of doing
this transparently without such low-level hacks?
(I still don't understand why having a large box inside doesn't cause
the containing box to enlarge itself...)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
And lo on Wed, 07 Nov 2007 09:36:17 -0000, Invisible <voi### [at] devnull> did
spake, saying:
> Phil Cook wrote:
>> And lo on Tue, 06 Nov 2007 18:21:42 -0000, Orchid XP v7 <voi### [at] devnull>
>> did spake, saying:
>>
<snip>
>> I'm sure you can get one of the languages you use to do something like
>> that.
>
> Well, that'll work... but surely there's some W3C compliant way of doing
> this transparently without such low-level hacks?
This is a W3C compliant way - HTML+CSS, what's not compliant about it? The
only thing you can moan about is the use of style in a strict.
> (I still don't understand why having a large box inside doesn't cause
> the containing box to enlarge itself...)
It does if you use a block rather then an inline element.
--
Phil Cook
--
I once tried to be apathetic, but I just couldn't be bothered
http://flipc.blogspot.com
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Phil Cook wrote:
> And lo on Wed, 07 Nov 2007 09:36:17 -0000, Invisible <voi### [at] devnull> did
> spake, saying:
>
>> Well, that'll work... but surely there's some W3C compliant way of
>> doing this transparently without such low-level hacks?
>
> This is a W3C compliant way - HTML+CSS, what's not compliant about it?
> The only thing you can moan about is the use of style in a strict.
It just seems a pitty to have to litter the code with style information
that should be in a seperate stylesheet, that's all.
What I *could* do is this:
style {padding: 1em;}
style style {padding: 2em;}
style style style {padding: 3em;}
etc.
But that still seems a crying shame...
>> (I still don't understand why having a large box inside doesn't cause
>> the containing box to enlarge itself...)
>
> It does if you use a block rather then an inline element.
But then it adds unwanted linebreaks.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
And lo on Wed, 07 Nov 2007 12:34:50 -0000, Invisible <voi### [at] devnull> did
spake, saying:
> Phil Cook wrote:
>> And lo on Wed, 07 Nov 2007 09:36:17 -0000, Invisible <voi### [at] devnull>
>> did spake, saying:
>>
>>> Well, that'll work... but surely there's some W3C compliant way of
>>> doing this transparently without such low-level hacks?
>> This is a W3C compliant way - HTML+CSS, what's not compliant about it?
>> The only thing you can moan about is the use of style in a strict.
>
> It just seems a pitty to have to litter the code with style information
> that should be in a seperate stylesheet, that's all.
>
> What I *could* do is this:
>
> style {padding: 1em;}
> style style {padding: 2em;}
> style style style {padding: 3em;}
> etc.
>
> But that still seems a crying shame...
Wrong way round. You could have a fixed css file containing the following
html {margin:20px;}
span {border: red 1px solid;}
span {padding:20px;}
span span {padding:18px;}
span span span {padding:16px;}
...
Assuming ten levels max and you would at least have a fixed height for the
equation you're displaying
>>> (I still don't understand why having a large box inside doesn't cause
>>> the containing box to enlarge itself...)
>> It does if you use a block rather then an inline element.
>
> But then it adds unwanted linebreaks.
Yep life's a bitch.
--
Phil Cook
--
I once tried to be apathetic, but I just couldn't be bothered
http://flipc.blogspot.com
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |