Print Reseller Scheme
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

css with html and .php

Discussion in 'Website Design Forum:' started by daver1982, Jan 27, 2012.

  1. daver1982

    daver1982 Junior Member

    hi.

    i have a question that i hope someone can answer for me about CSS if there is any reason that it is styling a page differently for me.

    I have a HTML site of which one of the pages i wanted to insert a script. So i changed the perticular page to php, inserted my script and it worked all fine.

    The issue i have is that the .php page styles differently than the rest of the HTML pages. Does this happen in general for html and php with css and if so is there any way other than creating a whole new style sheet that i can get this php page to fall inline with the others?

    many thanks in advance.

    dave
     
  2. mrp2049

    mrp2049 Senior Member

    Post what you are working on. It will make life easier.
     
  3. br3n

    br3n Senior Member

    Im no guru by any means but surely anything generated my php (in visual terms) will be html and therefor accessible/styled in the same way by css?
     
  4. jamescarroll89

    jamescarroll89 Junior Member

    The styling should be the same between HTML and PHP, there's not reason for it not to be. Is the outputted source code on both pages exactly the same? I'm thinking you might not have wrapped whatever your echoing in PHP with HTML so the elements won't be styled at all. Examples:

    Static HTML file:
    HTML:
    <html>
    <head>
    </head>
    <body>
    <h1>This is my page's main title</h1>
    </body>
    </html>
    
    PHP file:
    HTML:
    <html>
    <head>
    </head>
    <body>
    <?php echo "This is my page's main title"; ?>
    </body>
    </html>
    
    Notice in the second block of code there are not header tags.

    Post up your code and we'll have a look.
     

Share This Page