Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > CSS > CSS Cascading Style Sheets
|
CSS Cascading Style Sheets All issues relating to Cascading Style Sheets (CSS).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the CSS Cascading Style Sheets section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 2nd, 2004, 01:02 AM
cat cat is offline
Authorized User
 
Join Date: Jul 2004
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to get the line to go all the way down?

yup, it's me again.

i need to find out how to make the grey lines go all the way down to the footer on both sides. i've got it on the centre column [both sides] but when the rt column is longer ....

http://www.katzidesign.com/contact/index.htm

and if i put it on both in the css, i get a double line between the centre and the right columns.

thanks in advance, cat
 
Old November 2nd, 2004, 08:14 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Liquid height is a pretty tricky feat to accomplish. If I have time later I'll put together an example. In the mean time you can check out the links here: http://css-discuss.incutio.com/?page=ThreeColumnLayouts.



Regards,
Rich

--
[http://www.smilingsouls.net]
[http://pear.php.net/Mail_IMAP] A PHP/C-Client/PEAR solution for webmail
 
Old November 2nd, 2004, 09:22 AM
cat cat is offline
Authorized User
 
Join Date: Jul 2004
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thnks rich. i was thinking it was a bit difficult as i've been touching here and there on it without justice. i'll check out the links and see what i can find.

cat
 
Old November 6th, 2004, 10:34 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Hi Cat,

There is really only one way to achieve liquid height with CSS at present, and that technique involves specifying an absolute position and both the top and bottom offset properties, which when both are present and an element is absolutely positioned causes the element's height to be stretched. It's not exactly the most intuitive way to get it done, and here's the kicker, it doesn't work in IE. If you want to observe this technique there are two modifications to make to your style sheet. Code in red are styles that were added, code in blue are styles that were already there and I simplified into less declarations.

Code:
body{
    /* The font-family property is inherited, you only need to specify it once */
    font-family: Verdana, Arial, sans-serif;
    color: #444444;
    line-height: 1.166;
    /* Zero measurements do not require a unit */
    padding: 0;
    margin: 0;
    position: relative;
}
Code:
#ccolumn{
    position: absolute;
    top: 70px;
    bottom: 51px;
    left: 97px;
    float: left;
    width: 227px;
    border-left: 1px solid #cccccc;
    border-right: 1px solid #cccccc;
    padding: 30px 15px 0 15px;
    margin-top: 0;
    font-size: 70%;
}
You might be asking, what about percentage height? Percentage height is very tricky, because of three cornerstones of CSS, the box model, how height is calculated when no height is specified and what happens when a percentage height is specified.

 1. Height = Top Margin + Top Border + Top Padding + Height + Bottom Padding + Bottom Border + Bottom Margin. (the box model)

 2. When no height is specified an element expands only enough to accommodate its content (termed shrink-to-fit).

 3. When a percentage height is specified, the percentage height is calculated based on the height of the containing block.

So given the known rules you can come up with a test case.

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <title></title>
        <style type='text/css'>
        html, body {
            height: 100%;
        }
        body {
            border: 1px solid black;
            margin: 10px;
            padding: 10px;   
        }
        </style>
    </head>
    <body>
        <p>
           Hello, world! 
        </p>
    </body>
</html>
<html> and <body> are *both* given a 100% height, because of rules 2 and 3. The <body> won't fill up 100% of the <html> element because by default it only expands enough for the content inside of it, giving the <html> element a 100% height cures that. When you look at this in a browser you see a vertical scroll bar, and that happens as a result of rule 1, 100% of the height of the <html> element, which is itself 100% of the height of the browser window, plus margins, borders and padding takes up more room than is available causing scroll bars.

So the positioning solution doesn't work in IE, and percentage height isn't a very good solution given its idiosyncrasies. The positioning solution *is* what the standards say should happen, so IE is incorrect in its behavior. There are a few ways of making IE do what it's supposed to do, but all of them involve javascript AFAIK. This problem is addressed in dean edward's IE7, http://dean.edwards.name/ie7. Otherwise you might consider looking into the proprietary IE expression() feature.

/* For IE */
body {
    height: expression(/*Javascript goes here*/);
}

I'd include that via an IE conditional comment though, so that only IE sees it. If you don't know what that is, here's an example:
Code:
<!--[if lt IE 7]>
     <script src='/ie7/ie7-core.js' type='text/javascript'></script>
     <script src='/ie7/ie7-css2.js' type='text/javascript'></script>
     <script src='/ie7/ie7-png.js' type='text/javascript'></script>
<![endif]-->
The markup inside of the comments is only included if the browser is Windows IE and less than version 7, this can work for any markup, style sheets, content, whatever.

HTH!

Regards,
Rich

--
[http://www.smilingsouls.net]
[http://pear.php.net/Mail_IMAP] A PHP/C-Client/PEAR solution for webmail
 
Old December 13th, 2004, 02:49 AM
cat cat is offline
Authorized User
 
Join Date: Jul 2004
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi rich.

i didn't realize i hadn't been back to answer this one. i've had to shelve my personal site, to whip out this site -->> http://www.bmspresents.com/bms_try/index.html
and after that, i'll have to do this site -->> http://www.katzidesign.com/portillo/portillo.jpg

notice there are NO lines going all the way down in any of these designs. live and learn :-D

thanks for the above, i'll be back when the clients are out of the way

but i may just put a darkish area instead of fussing with with the lines. i didn't realize such a simple thing would end up being a big issue.

cat







Similar Threads
Thread Thread Starter Forum Replies Last Post
How to draw indicator line in owc line chart AlexOo General .NET 0 July 9th, 2007 10:32 PM
Reading a string from line by line vaidyapragati ASP.NET 2.0 Professional 1 May 3rd, 2007 08:43 AM
How to read file line by line in EVC++ iriskab Visual C++ 0 September 27th, 2006 01:39 PM
Reading line by line from a .txt file x_ray VB.NET 2002/2003 Basics 5 February 10th, 2006 01:55 PM
how can i take line by line in the richtextbox kamarajraj Beginning VB 6 0 August 12th, 2005 04:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.