#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2001
    Posts
    261
    Rep Power
    13

    CSS and php's include?? Best way??


    Hi there,

    Trying to make a tabelles site. Going to start with setting everything absolute. Done this in footer.php which i include in
    indexDev.php.

    Now how do i set the included footer.php relative to some div i have in indexDev.php? In a way that the included footer.php is some 'vertical' distance from the content in indexDev.php


    You understand what i mean?

    any tips on this subject?

    Grtz
    Last edited by D-flyer; September 18th, 2003 at 10:20 AM.
  2. #2
  3. Moderator Emeritus
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2002
    Location
    Austin, TX
    Posts
    7,186
    Rep Power
    2265
    Why aren't you simply linking the CSS sheet to your page via HTML?
    linking stylesheets
    DrGroove, Devshed Moderator | New to Devshed? Read the User Guide | Connect with me on LinkedIn
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2001
    Posts
    261
    Rep Power
    13
    Yep, i know.

    But that's is the next step. Where i will create classes for the div and combine them where nessecary

    And use @import for netscape issue.

    Your way is defenitly very good but i still have the issue:

    i want something like this:

    indexDev

    include header

    content

    include footer

    -------------------------
    right now i have css in footer
    PHP Code:
    <div id="btn_sitemap" style="position: absolute; left: 50px; top: 11px; width: 50; height: 20px; z-index: 2"><img src="images/btn_sitemap.gif" width="50" height="20"></div
    But when it get's included it is over the header.php of course. So how do i set in way that it will take the end of content as the beginning.

    Pfff i hope you understand me
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2004
    Posts
    3
    Rep Power
    0
    Im interested in this too if anyone has a hint or two for us?
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Posts
    34
    Rep Power
    11
    Why dont you just use a globle style sheet like drgroove said and set it to include in the header with <link rel="stylesheet" type="text/css" href="style/style.css"> in the <head> and then all styles are controlled from there. There is no point that I see in having seperate style allocations. Not unless I'm missing the point. Once the all the css tags are set in the style sheet you then just use <div id="'####"> tags
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2004
    Posts
    3
    Rep Power
    0
    I had a look around today and the best way I can find of doing what I wanted (and I hope what your talking about too) is to include a <div> above and a </div> below where you do the php include on the index page.

    eg:
    index.php:
    PHP Code:
    <div class="header">
    <?php
    include("header.htm");
    ?>
    </div>
    <div class="main_body">
    <?php
    include("main.htm");
    ?>
    </div>
    <div class="footer">
    <?php
    include("footer.htm");
    ?>
    </div>
    The included pages should then be relative to the divs that are set in the index.php page and not to the top of the page or to divs in other included pages.

    Hope this makes sense.

IMN logo majestic logo threadwatch logo seochat tools logo