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 7 of 7

Thread: Css Question

  1. #1
    Regular Coder
    Join Date
    Aug 2008
    Posts
    127
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Css Question

    Hi guys a bit of a dumb question probably.

    I have my css layout with a header at the top and on the content with right sidebar and footer

    With a white background for both the content and sidebar fields when I enter content both look to expand nicely and this looks great but when I put my background image in it doesn't seem to expand properly for example.

    If I have say red bg colour in my content and green in my sidebar if I put my text in the main content bit the green bar doesn't expand down and get a white bit under the base of the green thing (white hence looks normal without colour).

    What I want is for the bg colour of both boxes to expand down and for both boxes to be the same length no mater what the content of the other is.

    (my code for example)

    Code:
    #sidebar-a {
    	float: right;
    	width: 240px;
    	line-height: 18px;
    }
    
    #sidebar-a .padding {
    	padding: 25px;
    }
    
    
    #content {
    	margin-right: 240px;
    	line-height: 18px;
    }
    
    #content .padding {
    	padding: 25px;
    }
    
    
    h1 {
    	margin: 0;
    	padding: 0;
    	float: right;
    	margin-top: 54px;
    	padding-right: 31px;
    
    }
    
    #content h2 {
    	margin: 0;
    	padding: 0;
    	padding-bottom: 15px;
    
    }
    
    #content p {
    	margin: 0;
    	padding: 0;
    	padding-bottom: 15px;
    
    }

  • #2
    Regular Coder
    Join Date
    Jun 2007
    Posts
    805
    Thanks
    123
    Thanked 23 Times in 23 Posts
    That isn't a dump question at all. It has been discussed a lot in here. Have a look here for one solution: http://alistapart.com/articles/fauxcolumns/
    http://www.projectseven.com/tutorial...umns/index.htm
    Last edited by CaptainB; 03-05-2009 at 08:51 PM.

  • #3
    Regular Coder
    Join Date
    Aug 2008
    Posts
    127
    Thanks
    2
    Thanked 0 Times in 0 Posts
    that is great but I am still trying to get my head around css and this is not sinking in at the moment.

  • #4
    Regular Coder
    Join Date
    Jun 2007
    Posts
    805
    Thanks
    123
    Thanked 23 Times in 23 Posts
    Please provide a link to your site then.

  • #5
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    You need to clear your floats. Since you didn't post the css for your footer we can only assume that its not absolutely positioned. Add clear:both to the CSS for your footer.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #6
    Regular Coder
    Join Date
    Aug 2008
    Posts
    127
    Thanks
    2
    Thanked 0 Times in 0 Posts
    get it now I think, thanks
    Last edited by SteveDD; 03-05-2009 at 10:11 PM.

  • #7
    Regular Coder
    Join Date
    Aug 2008
    Posts
    127
    Thanks
    2
    Thanked 0 Times in 0 Posts
    entered in error
    Last edited by SteveDD; 03-05-2009 at 10:11 PM.


  •  

    Posting Permissions

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