Help with a layout issue

This is a discussion on "Help with a layout issue" within the Web Page Design section. This forum, and the thread "Help with a layout issue are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Jun 17th, 2007, 11:37
Junior Member
Join Date: May 2007
Location: London
Age: 17
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Help with a layout issue

I'm trying to stop making sites with tables and i'm making the change to CSS. I'm finding it difficult to get the layout how i'd like it, and it's really pushing me back to tables.

Here's the problem. I've designed a site that uses a sort of 'Two Row' layout. The top 'row' is a background image, where i'll be placing my navigation and such. The bottom 'row' is just a a regular background, possibly just one colour, I haven't decided exactly what it's going to be.

The problem i'm facing is that, i've defined the top background by putting it in

body {
margin: 0;
padding: 0;
text-align: center;
background: url("topbg.jpg") repeat-x top;
}

and now I can't seem to work out how I could get this bottom background to not go over the top background.

If you didn't understand that, It's hard to explain so i've added an image representation of my problem. I've looked around at quite a number of CSS help sites and haven't come across any answers. Any help would be greatly appreciated.
Attached Images
File Type: jpg Help.jpg (68.5 KB, 29 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Jun 17th, 2007, 12:00
Marc's Avatar
Staff Manager

SuperMember
Join Date: Apr 2007
Location: Scotland, UK
Posts: 1,794
Thanks: 0
Thanked 17 Times in 17 Posts
Re: Help with a layout issue

Sorry i didnt get you there but i think i know what you mean.

To get a background on the big box you need to do...

e.g.

.bigbox{
background-colour:#your_colour;
}

I am sorry if that isnt what you mean.

Marc
__________________
Marc
Staff Manager - Webforumz.com


Want to be a moderator? PM me.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Jun 17th, 2007, 14:27
Junior Member
Join Date: May 2007
Location: London
Age: 17
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help with a layout issue

Quote:
Originally Posted by mmfraser View Post
Sorry i didnt get you there but i think i know what you mean.

To get a background on the big box you need to do...

e.g.

.bigbox{
background-colour:#your_colour;
}

I am sorry if that isnt what you mean.

Marc
I'm afraid that doesn't work. I've found an example of this sort of layout, maybe someone could make sense of his CSS because I looked and couldn't.

www.gizcore.com

Notice that he also has the top background defined in the body.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Jun 17th, 2007, 14:38
Elite Veteran
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help with a layout issue

.body usually holds the page background.
To get a two row design like you are suggesting you would want a header div and a content div. (name them anything you want)

html
[code]<div id="header">All your header content here incuding your background and navigation</div>

<div id="content">All your lower content falls in this area</div>[code]

css would look like this;
Code: Select all
#header {     
background: url("topbg.jpg") repeat-x 0 0;
margin: 0 auto;
width: if you need one;
height: possibly;
}
#content {
    width: your amount;
    margin: 0 auto;
    text-align: sometimes;
    backtround:  url ("yourbg.jpg") repeat 0 0 ;
    }
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Jun 17th, 2007, 15:04
Up'n'Coming Member
Join Date: Jun 2007
Location: Germany
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help with a layout issue

that's how I would do it too! do it with 2 div layers, each with a different background.
You can also give the whole body the background for the second div, and then define a background for the first one. The second div would have background:transparent; (the body background would then "shine through")
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Jun 17th, 2007, 15:34
Junior Member
Join Date: May 2007
Location: London
Age: 17
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help with a layout issue

Quote:
Originally Posted by Lchad View Post
.body usually holds the page background.
To get a two row design like you are suggesting you would want a header div and a content div. (name them anything you want)

html
[code]<div id="header">All your header content here incuding your background and navigation</div>

<div id="content">All your lower content falls in this area</div>[code]

css would look like this;
Code: Select all
#header {     
background: url("topbg.jpg") repeat-x 0 0;
margin: 0 auto;
width: if you need one;
height: possibly;
}
#content {
    width: your amount;
    margin: 0 auto;
    text-align: sometimes;
    backtround:  url ("yourbg.jpg") repeat 0 0 ;
    }
Edit:
I was going to do it like that, but the problem is, it doesn't fill the screen like i'd like it to.

When it's defined with 'body' it looks like this: http://img403.imageshack.us/img403/3420/help2cs1.jpg
When it's defined using the header class, it looks like this: http://img115.imageshack.us/img115/1237/help3se5.jpg

As you can see, there's that ugly white border that I don't want.
Any ideas?

Thanks again.

Last edited by Kirryn; Jun 17th, 2007 at 15:56.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Jun 17th, 2007, 17:35
Junior Member
Join Date: May 2007
Location: London
Age: 17
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help with a layout issue

Resolved! Yay!
I do feel like a real idiot now, though, it was so simple...

body {
margin: 0;
padding: 0;
text-align: center;
background: #1F1F1F url(topbg.jpg) repeat-x top;}

I didn't realise I could use an image aswell as a colour. Well, time to move on to content. Thanks again to all those who helped.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Jun 17th, 2007, 23:06
Elite Veteran
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help with a layout issue

LOL! Good for you! The best lessons are the hard ones! Way to go!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Jun 21st, 2007, 17:07
Elite Veteran
Join Date: Aug 2005
Location: That Place
Posts: 2,044
Blog Entries: 1
Thanks: 0
Thanked 37 Times in 37 Posts
Re: Help with a layout issue

Should be

background: #1F1F1F url(topbg.jpg) left top repeat-x;}

BTW. =)
__________________

Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Jun 21st, 2007, 17:27
Elite Veteran
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help with a layout issue

^ actually no ... it's

Code: Select all
background: color image repeat attachment position;
so ...
Code: Select all
background: #1f1f1f url(topbg.jpg) repeat-x left top;
Proper CSS Shorthand
Efficient CSS with shorthand properties
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
css, help, layout, problem

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Major layout issue thewebkid Web Page Design 23 Dec 22nd, 2007 03:31
CSS Layout issue between IE and Firefox macu Web Page Design 2 Aug 22nd, 2007 13:14
Question about layout/IE7 issue bluetech Web Page Design 3 Jul 3rd, 2007 15:37
menu / layout positioning issue in IE Pixelate Web Page Design 2 May 9th, 2006 13:15
Homepage layout issue webwiz2000 Web Page Design 2 Feb 28th, 2006 17:49


All times are GMT. The time now is 21:49.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42