CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
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 May 7th, 2008, 12:18 AM
flashbck's Avatar
flashbck flashbck is offline
/* Spawn Killer Killer */
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Nov 2004
Location: New Orleans, LA, USA
Posts: 1,145 flashbck User rank is First Lieutenant (10000 - 20000 Reputation Level)flashbck User rank is First Lieutenant (10000 - 20000 Reputation Level)flashbck User rank is First Lieutenant (10000 - 20000 Reputation Level)flashbck User rank is First Lieutenant (10000 - 20000 Reputation Level)flashbck User rank is First Lieutenant (10000 - 20000 Reputation Level)flashbck User rank is First Lieutenant (10000 - 20000 Reputation Level)flashbck User rank is First Lieutenant (10000 - 20000 Reputation Level)flashbck User rank is First Lieutenant (10000 - 20000 Reputation Level)  Folding Points: 3924 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 19 h 12 m 30 sec
Reputation Power: 203
Specifying a percentage height for a div

So I have read a bunch of different results from my google searches and none seem to do what I would like. I'm beginning to think that there isn't really a solution at this point in time.

Here is my setup:
Code:
<div id='container'>
    <div id='header'></div>
    <div id='menuBar'></div>
    <div id='main'>
        <div id='content'></div>
    </div>
    <div id='footer'></div>
</div>

'header', 'menuBar', and 'footer' are all fixed height.

'main' MAY have a sub-menu div. When it does have this sub-menu, I would like for that sub-menu to be full height and 20% wide. Otherwise, I would like for 'content' to be as wide as possible. Currently I'm floating the sub-menu left and as a result the text in 'content' wraps around it after the bottom.

In case my description makes no sense...
Default Behavior:

Current Behavior:

Desired Behavior:

It's so pretty and colorful

I *could* create a second template for pages with a sub-menu, but I would prefer not to have to resort to that.

Reply With Quote
  #2  
Old May 7th, 2008, 03:13 AM
Akh's Avatar
Akh Akh is offline
|<.+#f@#+.&.|
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2002
Location: norway
Posts: 2,590 Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 12 h 38 m 37 sec
Reputation Power: 511
You can use the technique Faux colums.
Usually the divs don't have to have an equal height, just appear to be the same.
http://www.alistapart.com/articles/fauxcolumns/
__________________

Reply With Quote
  #3  
Old May 7th, 2008, 10:29 AM
flashbck's Avatar
flashbck flashbck is offline
/* Spawn Killer Killer */
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Nov 2004
Location: New Orleans, LA, USA
Posts: 1,145 flashbck User rank is First Lieutenant (10000 - 20000 Reputation Level)flashbck User rank is First Lieutenant (10000 - 20000 Reputation Level)flashbck User rank is First Lieutenant (10000 - 20000 Reputation Level)flashbck User rank is First Lieutenant (10000 - 20000 Reputation Level)flashbck User rank is First Lieutenant (10000 - 20000 Reputation Level)flashbck User rank is First Lieutenant (10000 - 20000 Reputation Level)flashbck User rank is First Lieutenant (10000 - 20000 Reputation Level)flashbck User rank is First Lieutenant (10000 - 20000 Reputation Level)  Folding Points: 3924 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 19 h 12 m 30 sec
Reputation Power: 203
Faux columns is one of the techniques that I read about.

Unfortunately, it will only make the background color extend down but the div height will still remain short and the 'content' div will still have text wrapping around it.

Faux Columns would work if I always had the sub-menu div in place, but this is not the case for me. If the sub-menu isn't present, I would like for the 'content' div to be centered within the 'main' div.

Reply With Quote
  #4  
Old May 7th, 2008, 11:03 AM
Akh's Avatar
Akh Akh is offline
|<.+#f@#+.&.|
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2002
Location: norway
Posts: 2,590 Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 12 h 38 m 37 sec
Reputation Power: 511
Just add a class for the different states.

Example:
Code:
html:
<div id='main' class="wide">
or
<div id='main' class="narrow">

Then in css.

.narrow #content {
  margin-left:20%;
  backround:url(faux.png) repeat-y;
}


Wordpress does this in the default theme,
you can see example of it here.
With sidebar :http://themes.wordpress.net/testrun/
without:http://themes.wordpress.net/testrun/?p=9
Comments on this post
flashbck agrees: Thanks, I knew it would e something simple

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > Specifying a percentage height for a div


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

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway