Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jan 2010
    Posts
    69
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Make background colour stretch to bottom

    Hi,

    i have a responsive website with a sidebar and a main content area - http://asdesigns.co.uk/lotus-blossum/bio.html

    What i would like to do is have the white background of the content area stretch all the way to the footer.

    I can't seem to work out how to do it.

    I know if it was fixed width website i could make the sidebar fixed width and have the background image that width and repeat-y and then add #fff and that would work but not sure how to do this with a responsive full width site.

    Any advice would be grateful thanks

  • #2
    Regular Coder COBOLdinosaur's Avatar
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    369
    Thanks
    2
    Thanked 26 Times in 26 Posts
    Well you can probably improve the display by using height:100vh but you are saying you want to do something that is totally counter to the underlying design that is intended to be responsive full width. In such a setup there is no certain way of getting the content down to the footer without setting it to a fixed value and using scripting to detect resolution and modify the values accordingly.

    You might be able to do it with media queries but that could run into cross-device issues.
    100% standards compliant code is 100% correct 100% of the time.
    one of my toys from my repository and perhaps some help getting help

    Cd&

  • #3
    New Coder
    Join Date
    Jan 2010
    Posts
    69
    Thanks
    12
    Thanked 0 Times in 0 Posts
    Hi

    Thanks for replying.

    I dont understand what you mean but i think im going to use the jquery plugin syncHeight that foundation recommend

  • #4
    Regular Coder COBOLdinosaur's Avatar
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    369
    Thanks
    2
    Thanked 26 Times in 26 Posts
    Yeah if the effect is that important then using a recommended plugin will at least give you a single source of you need support.
    100% standards compliant code is 100% correct 100% of the time.
    one of my toys from my repository and perhaps some help getting help

    Cd&

  • #5
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,673
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello saunders1989,
    A full height layout is all you're trying to do, something like this should work fine.

    Here's a start at it -
    Code:
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title></title>
    <style type="text/css">
    html, body{
    	height: 100%;
    	margin: 0;
    	font: 100% "Trebuchet MS", Arial, Helvetica, sans-serif;
    	color: #000;
    	background: url(http://asdesigns.co.uk/lotus-blossum/images/sidebar_bg.jpg);
    }
    #wrap {
    	min-height: 100%;
    	margin: 0 0 -130px; /* the bottom margin is the negative value of the footer's height */
    	position: relative;
    	text-align: left;
    	background: #fff;
    }
    #sidebar {
    	width: 25%;
        padding: 18px 0 29px;
    	float: left;
        text-align: center;
    }
    #tagline {
        margin: 0 5% 22px;
        padding: 14px 0;
        border-bottom: 1px dashed #8F8250;
        border-top: 1px dashed #8F8250;
    }
    #page_title,
    #content {margin: 0 0 0 25%;}
    	#page_title {
    		background: url("http://asdesigns.co.uk/lotus-blossum/images/page_title_bg.jpg");
    		height: 103px;
    		padding: 46px 54px 0 40px;
    	}
    		#page_title h1 {
    			border-bottom: 1px dashed #FFFFFF;
    			color: #FFFFFF;
    			font-family: 'Zeyada',cursive;
    			font-size: 40px;
    			font-weight: normal;
    			line-height: 30px;
    			margin: 0;
    			padding: 0 0 7px;
    		}	
    #content {padding: 29px 52px 130px 40px;;}
    #footer {
    	height: 111px;
    	width: 100%;
        padding: 19px 0 0;
    	position: absolute;
    	bottom: 0;
    	background: url(http://asdesigns.co.uk/lotus-blossum/images/footer_bg.jpg);
    	text-align: center;
    }
    </style>
    </head>
    <body>
        <div id="wrap">
    	<div id="sidebar">
    		<a href="*" id="logo"><img alt="Lotus Blossom" src="http://asdesigns.co.uk/lotus-blossum/images/logo.png"></a>
    			<div id="tagline">
    				<p>environmentally friendly</p>
    				<p>textile art, inspired by nature</p>
    			<!--end tagline--></div>
    	<!--end sidebar--></div>
    		<div id="page_title">
    			<h1>bio</h1>
    		<!--end page_title--></div>
    		<div id="content">
                <p>
                    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna 
                    aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no 
                    sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam 
                    nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo 
                    duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
                </p>
                <p>
                    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna 
                    aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no 
                    sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam 
                    nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo 
                    duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
                </p>
    		<!--end content--></div>
    		<div id="footer"></div>
        <!--closes wrap--></div>
    </body>
    </html>
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •