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
    New to the CF scene
    Join Date
    Jan 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Maintaining centre alignment of php

    I am currently customizing a shop page for a sports club. I have set up the template in html and it is called into the main page which is php. The template works perfectly on its own with all expected functionality in place and it also works perfectly in the php page.

    Fine so far, however, the template is centered when viewed itself but when called into the php page it lose margins and becomes left aligned.

    Tried basic
    <center>
    type fixes to realign including auto margins fix but to no avail.

    How do i realign a center aligned page for php use while retaining the core format of the template.

    Suggestions gratefully received
    .

    CSS extract

    /************/
    /* GLOBAL */
    /************/

    /* NON-HEADER */
    *{
    padding:0;
    margin:0;
    }
    body {font-size:62.5%; background-color:rgb(255,255,255); font-family:verdana,arial,sans-serif;word-wrap: break-word;} /*Font-size: 1.0em = 10px when browser default size is 16px*/
    .page-container {
    width:900px;
    margin:0px auto;
    margin-top:10px;
    margin-bottom:10px;
    border:solid 1px rgb(150,150,150);
    font-size:1em;
    max-width: 900px;
    }
    .main {
    clear:both;
    width:900px;
    padding-bottom:30px;
    background:transparent url(/images/bg_main_withnav.jpg) top left repeat-y;
    max-width: 900px;

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,692
    Thanks
    22
    Thanked 1,830 Times in 1,814 Posts
    Hello jamaro,
    That bit you quoted looks like it should center the 900px wide .page-container. If that's your template there must be something in the page that loading it that is conflicting...

    Hard to say without seeing it. Do you have a link?

    Could tidy this up a bit:
    Code:
    .page-container {
    width:900px;
    /*margin:0px auto;
    margin-top:10px;
    margin-bottom:10px;*/
    margin: 10px auto; /*this does the same as the 3 lines above it*/
    border:solid 1px rgb(150,150,150);
    font-size:1em;
    max-width: 900px;
    }
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad


  •  

    Posting Permissions

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