Grow your CSS skills. Land your dream job.

..Help with positioning and using a personal template

  • # June 30, 2008 at 12:30 pm

    Hi..

    I was wondering if you guys could help me on a little issue or two that I have.

    Positioning:
    The first one is regarding the change of position of the content/menu (using the same coding – I believe!) between various pages on here. For example, if you first click "Rhuematology", then after that click "Paediatrics" you will see that the menu, content title/content and footer all move slightly up. This happens between various pages, why would this be? Any advice on how to solve this?

    Templates:
    Also, as you can see the page header, menu and footer remain the same throughout the website. Is there a way to use a template so that this information is not reloaded each time you view a different page (I’ve seen the Dreamweaver template option – is it this or maybe an "include"?).

    Thanks again guys, any advice is greatly appreciated!

    Darren

    # June 30, 2008 at 8:34 pm

    Positioning
    It looks like you have different definitions for "p" in your files. Some files use p {margin: 0; } and some use p {margin: 5px; } causing your content to shift either up or down. You should use one external style sheet and include that file in each of your HTML files.

    You should move your CSS to a separate file (to avoid inconsistencies like this), and link the CSS file your HTML files.
    <link href="yourCSS.css" rel="stylesheet" type="text/css" />
    Then when you make changes to your CSS, you only need to edit the one file and not each HTML file.

    Other
    If you use PHP, you could include the header, footer, menu, etc. in each file, if your server supports PHP.
    Example:
    /* index.php file */
    <body>
    <?php include ‘header.inc’; ?>

    <?php include ‘footer.inc; ?>
    </body>
    You could google this topic by searching for something like "how to use PHP includes"

    # July 1, 2008 at 5:43 am

    Thanks Laith.. I will look into this and hopefully sort the problem now!!
    :D

    # July 1, 2008 at 6:33 am

    I managed to sort the "p" issue out and I am now using the external linked stylesheet as suggested!

    Still to look into using an include for the footer, header, menu etc but in the meantime, does anyone know why the footer is now moving on the page and not sitting to the bassline as previous. The CSS code is here.

    Website – http://www.studentdoctors.co.uk.

    Thanks,

    Darren

    # July 2, 2008 at 12:19 pm

    Anybody? I’m using the same CSS code as before (when I had the CSS on each page and not linking to the external stylesheet).

    Seems strange that it worked before but doesn’t any longer?

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".