By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,487 Members | 1,067 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,487 IT Pros & Developers. It's quick & easy.

How to increase the height of left panel div as the content div increases.

P: 2
Hello
Can any body help me with this
The problem is

As the text increses in height the side bar should also increase.

As shown in pic.
[IMG][/IMG]

Expand|Select|Wrap|Line Numbers
  1.  
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  6. <title>Untitled Document</title>
  7. </head>
  8. <style>
  9. body{
  10. margin:0px;
  11. height: 100%;
  12. }
  13. .home1
  14. {
  15. margin-left:20px;
  16. margin-top:20px;
  17. width:350px;
  18. clear:left;
  19. }
  20. .home1_text
  21. {
  22.     padding-left:4px;
  23.     font:9pt Arial, Helvetica, sans-serif;
  24.     float:left;
  25. }
  26. .home1_bar
  27. {
  28.     width:15px;
  29.     background-color:#90BFCF;
  30.     height:100%;
  31.     float:left;
  32. }
  33. </style>
  34.  
  35. <body>
  36. <div class="home1">
  37.                 <div class="home1_bar"></div>
  38.                 <div class="home1_text">We intend to assist deserving Indian manufacturers of workshop tools, to export in the world market using                 our experience and contacts of over 50 years.
  39.                 </div>
  40. </body>
  41. </html>
  42.  
  43.  
Mar 22 '07 #1
Share this Question
Share on Google+
7 Replies


Yanskopolis
P: 9
It already does increase in height.
Mar 22 '07 #2

Yanskopolis
P: 9
Oh wait, you're talking about the sibling div right? The only way you could make it's height relative to the content of a sibling element is to use Javascript.
Mar 22 '07 #3

drhowarddrfine
Expert 5K+
P: 7,435
As usual, validate for your list of errors that will fix this problem.
Mar 22 '07 #4

Expert 100+
P: 1,892
You can use percentages to help. When you say the text increases you mean when you add content?
Mar 22 '07 #5

P: 2
You can use percentages to help. When you say the text increases you mean when you add content?
Hello Folks,
let me agian explain my problem.
if you see the code
the div with class home1_bar should increase in height as the text matter in the div with class home1_text increases.
Presently the div with class home1_bar remains of the same height irrespective of the increase in the text matter in div with home1_text.
Mar 23 '07 #6

drhowarddrfine
Expert 5K+
P: 7,435
And I repeat again, fix your errors to fix the problem.
Mar 23 '07 #7

P: 1
I have no idea what you're trying to accomplish, but this will give you a different result:

<div class="home1">
<div class="home1_bar">
<div class="home1_text">We intend to assist deserving Indian manufacturers of workshop tools, to export in the world market using our experience and contacts of over 50 years.
</div>
</div>
</div>
Mar 23 '07 #8

Post your reply

Sign in to post your reply or Sign up for a free account.