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 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Jun 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Site ignores content width in CSS page

    I'm not sure if I should put this here or in the PHP forum, but I think it's more of a HTML and CSS problem.

    My site had the header, footer, and sidebars on every page and I decided to put each in a different file so I wouldn't have to update them on every page. I made a header.html and did the same with my sidebar and footer, I changed the index.html to .php and included the other files to test it.

    Everything shows up, but the sidebar shows up on the far side of the page, and not close to the main column where it should be.

    My CSS includes #content {width:1040px;}, but right now it spans the whole page.

    I think the sidebar is also ignoring the sidebar width in the CSS file.

    Can I not use CSS and PHP like this together? Is there any other way to do this to make the width 1040 px?

    Thanks!

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Welcome!
    Definitely a CSS / HTML issue. Its possible that you lost a tag set in there when separating the content into separate files. I'm not a client developer, but I assure you the client guys will want a link to you're site or full source html + css to determine the trouble.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • #3
    Regular Coder BoldUlysses's Avatar
    Join Date
    Jan 2008
    Location
    Winston-Salem, NC
    Posts
    938
    Thanks
    10
    Thanked 190 Times in 187 Posts
    A link to your page would be helpful. Alternatively, you could post your whole HTML and CSS, but the first option is more useful because it allows us to see everything in context (including images).

    Without that, my first instinct would be to view your "PHP-ified" output and compare it to your pre-PHP plain HTML page to make sure it's getting assembled correctly. If the markup output is identical I would check to make sure your filepaths are correct.
    matt | design | blog

  • #4
    New to the CF scene
    Join Date
    Jun 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The pages are Blooged.com/index.html for how it should look and Blooged.com/index.php for the one that isn't aligned correctly. Forgot to put those.

    You should block the godaddy ad at the top if it isn't already to view it correctly.
    Last edited by Celestiax; 06-09-2009 at 05:05 AM. Reason: Forgot information

  • #5
    New to the CF scene
    Join Date
    Jun 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I've tried a few things and still can't get it to work. Any help would be appreciated.

  • #6
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,957
    Thanks
    9
    Thanked 727 Times in 721 Posts
    I may be missing something here, but index.php doesn't have #content div...

  • #7
    New to the CF scene
    Join Date
    Jun 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Wow, thanks. I don't know how I didn't see that.


  •  

    Posting Permissions

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