This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Stylesheets > May 2006 > possible





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author possible
Oliver Block

2006-05-06, 10:51 pm

Hello,

intro:

..full { width: 100px }

..half { width: 50 px }

Is it now somehow possible to change the definition of the class half in a
way that its width depends on the width of the class full?

I am just wondering if that is possible.

Best Regards,

Oliver

ironcorona

2006-05-07, 3:47 am

Oliver Block wrote:
> Hello,
>
> intro:
>
> .full { width: 100px }
>
> .half { width: 50 px }
>
> Is it now somehow possible to change the definition of the class half in a
> way that its width depends on the width of the class full?
>
> I am just wondering if that is possible.


If you enclose the block level element inside a "frame" then you can
make the widths relative to the size of the frame. You can then give
the frame an absolute width. It would achieve the same effect.

An example:

[...]

<style type="text/css">
..frame {width:100px;}
..full {width:100%;}
..half {width:50%;}
</style>
</head>

<body>

<div class="frame">
<div class="full"></div>
<div class="half"></div>
</div>

[...]


--
ironcorona
Jim Moe

2006-05-07, 3:47 am

Oliver Block wrote:
>
> intro:
> .full { width: 100px }
> .half { width: 50 px }
>
> Is it now somehow possible to change the definition of the class half in a
> way that its width depends on the width of the class full?
>

Rather than a frame, set the width of .half to a percentage and put it
inside of .full.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
ironcorona

2006-05-07, 6:51 am

Jim Moe wrote:
> Oliver Block wrote:
> Rather than a frame, set the width of .half to a percentage and put it
> inside of .full.


*smacks forehead* But of course!

--
ironcorona
Oliver Block

2006-05-08, 6:54 pm

Hi,


Jim Moe wrote:

> Oliver Block wrote:
> Rather than a frame, set the width of .half to a percentage and put it
> inside of .full.


And if .half is a sibling of .full?

Best Regards,

Oliver
Jim Moe

2006-05-08, 6:54 pm

Oliver Block wrote:
>
> And if .half is a sibling of .full?
>

You need another div to contain .full and .half. Use a percentage for
..full and set .half's width to half of .full's width.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews