CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 17th, 2012, 03:45 PM
ngr ngr is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 5 ngr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 34 m 34 sec
Reputation Power: 0
Simple problem - but impossible for a newbie

I had started making my new site with frames - like this:

A header from left to right, 100 pixels high

Under that

A menu frame in the left side, 300 pixels wide
A content frame, filling the rest of the screen.

But then I tried to make it with CSS instead - but after having fought with it for 5 hours, I gave up.

Can someone help me with some code I can use?

Thanks a lot

Reply With Quote
  #2  
Old December 17th, 2012, 04:54 PM
rdoyle720 rdoyle720 is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Dec 2003
Posts: 646 rdoyle720 User rank is Major (30000 - 40000 Reputation Level)rdoyle720 User rank is Major (30000 - 40000 Reputation Level)rdoyle720 User rank is Major (30000 - 40000 Reputation Level)rdoyle720 User rank is Major (30000 - 40000 Reputation Level)rdoyle720 User rank is Major (30000 - 40000 Reputation Level)rdoyle720 User rank is Major (30000 - 40000 Reputation Level)rdoyle720 User rank is Major (30000 - 40000 Reputation Level)rdoyle720 User rank is Major (30000 - 40000 Reputation Level)rdoyle720 User rank is Major (30000 - 40000 Reputation Level)rdoyle720 User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 2 Weeks 3 Days 4 h 44 m 24 sec
Reputation Power: 400
There's probably a lot more you want that you're not mentioning, but in the most basic terms, things flow top to bottom naturally. To get things to display side by side you can "float" elements (though that's not the only way).

An ultra basic approach to what you're describing would be:

Code:
<div class="header">Header</div>
<div class="menu">Menu</div>
<div class="content">Content</div>


Then in your CSS:

Code:
.header {height: 100px; background: red}
.menu {width: 300px; float: left; background: blue}
.content {background: yellow}


If you have any design sense you'll come back and say things like "but I want the menu to be as tall as the content" and "I want a footer at the bottom of the screen no matter how tall the page is" and that's where you get into the more complicated stuff. But the above is the basic shell of what you're talking about.

Reply With Quote
  #3  
Old December 17th, 2012, 09:19 PM
ngr ngr is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 5 ngr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 34 m 34 sec
Reputation Power: 0
Oh, mine

Are you sure, that works - always?
I am asking, because other suggestions, I have seen, are far more complicated.

Reply With Quote
  #4  
Old December 17th, 2012, 09:26 PM
ngr ngr is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 5 ngr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 34 m 34 sec
Reputation Power: 0
One problem :(

I want the whole screen to have the same colour (maybe with the menu on top of it with a different colour).

How do I do that?

Reply With Quote
  #5  
Old December 17th, 2012, 09:30 PM
ngr ngr is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 5 ngr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 34 m 34 sec
Reputation Power: 0
Solved it

Giving the body div the colour I want must be the correct way?

Reply With Quote
  #6  
Old December 18th, 2012, 08:27 AM
rdoyle720 rdoyle720 is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Dec 2003
Posts: 646 rdoyle720 User rank is Major (30000 - 40000 Reputation Level)rdoyle720 User rank is Major (30000 - 40000 Reputation Level)rdoyle720 User rank is Major (30000 - 40000 Reputation Level)rdoyle720 User rank is Major (30000 - 40000 Reputation Level)rdoyle720 User rank is Major (30000 - 40000 Reputation Level)rdoyle720 User rank is Major (30000 - 40000 Reputation Level)rdoyle720 User rank is Major (30000 - 40000 Reputation Level)rdoyle720 User rank is Major (30000 - 40000 Reputation Level)rdoyle720 User rank is Major (30000 - 40000 Reputation Level)rdoyle720 User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 2 Weeks 3 Days 4 h 44 m 24 sec
Reputation Power: 400
Yes, assigning a background color to the <body> would be one way to handle that.

Reply With Quote
  #7  
Old December 19th, 2012, 07:28 AM
ngr ngr is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 5 ngr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 34 m 34 sec
Reputation Power: 0
Doesn't work

When I put enough text in the content, that last of it is placed beneath menu

Reply With Quote
  #8  
Old December 19th, 2012, 09:12 AM
rdoyle720 rdoyle720 is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Dec 2003
Posts: 646 rdoyle720 User rank is Major (30000 - 40000 Reputation Level)rdoyle720 User rank is Major (30000 - 40000 Reputation Level)rdoyle720 User rank is Major (30000 - 40000 Reputation Level)rdoyle720 User rank is Major (30000 - 40000 Reputation Level)rdoyle720 User rank is Major (30000 - 40000 Reputation Level)rdoyle720 User rank is Major (30000 - 40000 Reputation Level)rdoyle720 User rank is Major (30000 - 40000 Reputation Level)rdoyle720 User rank is Major (30000 - 40000 Reputation Level)rdoyle720 User rank is Major (30000 - 40000 Reputation Level)rdoyle720 User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 2 Weeks 3 Days 4 h 44 m 24 sec
Reputation Power: 400
I wouldn't say it "doesn't work", you're just simply noticing the things that aren't there you didn't ask for. Coming from frames, if I had told you everything you needed for a bulletproof CSS design, your head would have exploded.

When you float something, other content will wrap around it. You can stop that by either setting a margin on that content, or by setting the content to overflow: hidden or auto.

If you add overflow: hidden to your content CSS, it will no longer wrap underneath the menu. (Cue your next complaint that the menu and content aren't the same height in 5...4...)

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > Simple problem - but impossible for a newbie

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap