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

Having trouble with displaying these div's

100+
P: 290
Hi,

I am having difficulty seeing why my divs will not swap places :confused:

I want to swap the positions of the "Hot News" and the "Todays Bonuese" sections.

Here is how they look now:



And when I try and swap the positions I get this:



This is my code:

Expand|Select|Wrap|Line Numbers
  1. <div class="wrapper">
  2. <div class="insidewrapper">
  3.  
  4. <div class="out_box hot_news">
  5. <span class="hot02">Hot News</span>
  6. <div class="hot_news03">
  7.  
  8. <---   THIS IS THE FIRST DIV SECTION --->
  9.  
  10. <div class="hot04">
  11. <p><span style="font-size: 14px;color:darkblue; font-weight: bold;">The five part tutorial series has been completed and they are awesome.</span><br>
  12.  <br>
  13. These will help all new experts to quickly get familiar with the powerful facilities that they have at their fingertips.
  14. <br><br>
  15. The tutorials are under the <b>Free Tuition</b> tab.<br>
  16. 1) How to Become a Recognized Expert <br>
  17. 2) How to Upload and Use Your Images<br>
  18. 3) How to Add Stunning Images to Your Articles<br>
  19. 4) How to Build a Great Product Sales Page<br>
  20. 5) How to Link From Your Articles to Your Products<br>
  21. <br>
  22. <br><br>
  23. <span style="font-size: 14px; color:darkblue; font-weight: bold;">Three new tools recently added:</span>
  24. <br><br>
  25. <b>CHAOS Submitter</b> This is a industrial strength program made for the more demanding Webmaster. 
  26. If you're looking for the most unique and targeted visitors, the the CHAOS submitter will help you.  
  27. <br><br>
  28. <b>Competitor Google Tool</b> This tool grphically displays the relationship of a website within Google and Yahoo. Compare your website with the competion and see where to improve.
  29. <br><br>
  30. <b>Banner Creator.</b> Very easy to use. Create your own free banners quickly and easily.  
  31. </p>
  32. </div> <!-- End div:hot04 --> 
  33. </div> <!-- End div:hot03 -->
  34. </div> <!-- End div:out_box hot_news -->
  35.  
  36. <---   THIS IS THE SECOND DIV SECTION --->
  37.  
  38. <div class="out_box hot01">
  39.  <span class="hot02">Join Today Bonuses</span>
  40.   <div class="in_box hot03">
  41.      <div class="hot04">
  42.       <div style="margin: 0 0 0 20px;">
  43.        <a href="/im/index1.php">Become a free member today and pick 
  44.        up these introductory gifts:</a>
  45.           <br><br>
  46.          <a href="/im/index1.php">
  47.           <img alt="link building" src="http://www.expert-world.com/sys_images/TA-box.png" height="75px" width="80px" />
  48.          <img alt="gift (15K)" src="http://www.expert-world.com/sys_images/IMs.png" height="75px" width="80px" />
  49.          <img alt="gift (15K)" src="http://www.expert-world.com/sys_images/tool-kit-box.png" height="75px" width="80px" />
  50.          <img alt="gift (15K)" src="http://www.expert-world.com/sys_images/BCT.jpg" height="75px" width="80px" />
  51.          </a>
  52.          </div>
  53.      </div> <!-- End div:hot04 -->
  54.     </div> <!-- End div:hot03 -->
  55. </div> <!-- End div:hot01 -->
  56.  

The relevant css is:
Expand|Select|Wrap|Line Numbers
  1. .wrapper {
  2.   width: 950px;
  3.     min-height:100%;
  4.   overflow:hidden;
  5.   border: 1px;
  6.   border-style: solid;
  7.   border-right-color: #ccc;
  8.   border-left-color: #ccc;
  9.   border-top-style: none;
  10.   margin: 0px 0px 0px 150px; 
  11.   padding: 0px 0px 0px 0px;
  12.   border-bottom-style: none;
  13.   text-align: center;
  14. }
  15.  
  16. .insidewrapper {
  17.   width: 900px;
  18.   color :#6385AD;
  19.     color :#000;
  20.   margin: 0px auto 0px auto;
  21. }
  22.  
  23. .out_box{  
  24.   float:left;
  25.     text-align: left;
  26.     margin: 0 0 0 10px;
  27.     display:inline;
  28.  }
  29.  
  30. .hot01{
  31.   width:180px;
  32. }
  33.  
  34. .hot02{
  35.   color :#000;
  36.   font-size: 14px; 
  37.   font-weight: bold; 
  38.     text-align: left;
  39.  }
  40.  
  41. .in_box{
  42.   border: 1px;
  43.   border-style: solid;
  44.   border-color: #ccc;
  45.   float:left;
  46.     text-align: left;
  47.     margin: 10px;
  48.  }
  49.  
  50. .hot03{
  51.   width:150px;
  52.     height:390px;
  53.  }
  54.  
  55. .hot04{
  56.   font-size: 12px; 
  57.      margin: 10px;
  58. }
  59.  
  60. .hot_news{
  61.   width:480px;
  62. }
  63.  
  64. .hot_news03{
  65.   width:480px;
  66. }
  67.  
When I try and swap the divs I just take the first div and out it under the second section. Unfortunately, the "Bonus" box slides over to the right, even though it is floated left - I don't see why :o

Would really appreciate you advice.
Oct 9 '09 #1
Share this Question
Share on Google+
1 Reply


TheServant
Expert 100+
P: 1,168
I am presuming you do close your wrapper div?

Anyway, I have used this with your stylesheet and it can switch them around no problem. Don't think I changed anything significant.

Expand|Select|Wrap|Line Numbers
  1. <link rel="stylesheet" href="test.css" type="text/css" />
  2. <div class="wrapper"> 
  3.     <div class="insidewrapper"> 
  4.  
  5.     <div class="out_box hot01"> 
  6.         <span class="hot02">Join Today Bonuses</span> 
  7.         <div class="in_box hot03"> 
  8.             <div class="hot04">
  9.                 <p>this is bonus</p>
  10.             </div>
  11.         </div>
  12.     </div>
  13.     <div class="out_box hot_news"> 
  14.         <span class="hot02">Hot News</span> 
  15.         <div class="hot_news03">              
  16.             <div class="hot04">
  17.                 <p>this is news</p>
  18.             </div>
  19.         </div>
  20.     </div>
  21. </div>
I can't see the rest of your page but you should find out what is filling the space between your left column and the bonuses which is pushing the news below. Simply add a background color to each main div to see which one it is and then deal with that one.
Oct 13 '09 #2

Post your reply

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