POV-Ray : Newsgroups : povray.off-topic : Small CSS question Server Time
11 Oct 2024 11:11:13 EDT (-0400)
  Small CSS question (Message 11 to 20 of 38)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Phil Cook
Subject: Re: Small CSS question
Date: 6 Nov 2007 12:10:30
Message: <op.t1drbcl8c3xi7v@news.povray.org>
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

From: Phil Cook
Subject: Re: Small CSS question
Date: 6 Nov 2007 12:24:43
Message: <op.t1dry0xyc3xi7v@news.povray.org>
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

From: Orchid XP v7
Subject: Re: Small CSS question
Date: 6 Nov 2007 13:21:39
Message: <4730b0b3$1@news.povray.org>
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

From: Greg M  Johnson
Subject: Re: Small CSS question
Date: 6 Nov 2007 22:26:52
Message: <4731307c@news.povray.org>
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

From: Nicolas Alvarez
Subject: Re: Small CSS question
Date: 6 Nov 2007 22:56:34
Message: <47313772$1@news.povray.org>

> 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

From: Phil Cook
Subject: Re: Small CSS question
Date: 7 Nov 2007 04:06:29
Message: <op.t1ezimvmc3xi7v@news.povray.org>
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

From: Invisible
Subject: Re: Small CSS question
Date: 7 Nov 2007 04:36:18
Message: <47318712$1@news.povray.org>
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

From: Phil Cook
Subject: Re: Small CSS question
Date: 7 Nov 2007 05:22:24
Message: <op.t1e200osc3xi7v@news.povray.org>
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

From: Invisible
Subject: Re: Small CSS question
Date: 7 Nov 2007 07:34:51
Message: <4731b0eb$1@news.povray.org>
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

From: Phil Cook
Subject: Re: Small CSS question
Date: 7 Nov 2007 09:16:00
Message: <op.t1fds5gmc3xi7v@news.povray.org>
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

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.