Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jul 2009
    Posts
    204
    Thanks
    27
    Thanked 0 Times in 0 Posts

    fixed content in every page vs page specific content

    Hello,
    The code below is the main wrapper div and its contents that I am planning to use in every page.

    I have three questions:
    1-Before I was using absolute positioning to position everything. Since I learned that is wrong, I switched to this route. How does this look in general as this is my first time using divs like this, am I missing something major?

    2-Everything in these divs will go to every page, as they contain the logo, menus, google ads etc..., except where it says "page specific content goes here. Only that div is to include page specific content. Therefore it will be varying height. So I want its height to adjust automatically . I said height:auto, and it first seemed to work fine, when i added text only. BUT when I added a file called top_list.html as seen below, the height of the div did not adjust automatically for that top_list file display height. How can I solve that? Should I put specific div heights in that section, at each case?

    3-As I said before, everything here goes to every page except page specific content. So I dont want to paste this entire thing to every page. But if I write this in a single file called say, all-fixed-items, and then use php include to include it in every page, then how can I insert the page specific content into that div that contains page specifc items?

    Code:
    <div style="background-color: #ffffff; border:1px solid red; width: 940px; height: auto; float:left;">
    
    	<div style="background-color: #ffffff; border:1px solid green; width: 470px; height: 68px; float:left;    margin-top:-4px;    ">
    	<?php
    	include("logo.php");
    	?>
    	</div>
    
    	<div style="background-color: #ffffff; border:1px solid blue; width: 460px; height: 64px; float:left;">
    	<?php
    	include("googleads_top.php");
    	?>
    	</div>
    
    	<div style="background-color: #ffffff; border:1px solid yellow; width: 940px; height: 70px; float:left;">
    	<?php
    	include("menu_top.php");
    	?>
    	</div>
    
    
    	<div style="background-color: #ffffff; border:1px solid black; width: 175px; height: 900px; float:left;">
    	<?php
    	include("menu_side.php");
    	?>
    	<?php
    	include("googleads_left.php");
    	?>
    	</div>
    
    	<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////-->
    	<!-- ////////////////////////////////////////////////////////PAGE SPECIFIC CONTENT GOES HERE////////////////////////////-->
    	<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////-->
    	<div style="background-color: #ffffff; border:1px solid black; width: 760px; height: auto; float:left;">
    	MAIN CONTENT GOES HERE. MAIN CONTENT GOES HERE. MAIN CONTENT GOES HERE.
    	<?php
    	include("top_items_list.html");
    	?>
    	</div>
    	<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////-->
    	<!-- ////////////////////////////////////////////////////////END OF PAGE SPECIFIC CONTENT///////////////////////////////-->
    	<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////-->
    
    
    	<div style="background-color: #ffffff; border:1px solid black; width: 800px; height: 170px; float:left;">
    	<?php
    	include("googleads_bottom.php");
    	?>
    	<?php
    	include("menu_bottom.php");
    	?>
    	</div>
    
    </div>

  • #2
    met
    met is offline
    Regular Coder
    Join Date
    Oct 2009
    Location
    United Kingdom
    Posts
    728
    Thanks
    4
    Thanked 119 Times in 119 Posts
    a link to your page would be very useful

    my guess is when you include top_list.html you are floating its contents, and not clearing the container so the height doesn't expand as you wish.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •