PHP Incude / CSS question

Discussion in 'PHP' started by Cain Fleming, Dec 20, 2010.

  1. #1
    I have used PHP Include to add a form onto a web page.

    The form has its own external CSS sheet.

    When I include the form onto my web page, all of the styling changes dramatically.

    The web page has its own style sheet also, I believe this is what's causing the problem.

    I am new to PHP and am a novice at CSS, so hopefully you can help.

    Will I have to change the main style sheet for my website to incorporate the form CSS?

    Or is there a way round having to do this?

    Thanks

    Cain
     
    Cain Fleming, Dec 20, 2010 IP
  2. shallowink

    shallowink Well-Known Member

    Messages:
    1,218
    Likes Received:
    64
    Best Answers:
    2
    Trophy Points:
    150
    #2
    The short answer is that you should include the form stylesheet into the website in the head section.

    The incorrect answer is that you could include a LINK tag to the form stylesheet when the form is included. It will work that way but the resulting page will not validate.
     
    shallowink, Dec 20, 2010 IP
  3. Cain Fleming

    Cain Fleming Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi,

    Thanks for the reply.

    I have tried this, maybe I'm not doing it right.

    Will I have to tag my php include to the stylesheet?

    Hope this makes sense.

    Cheers
     
    Cain Fleming, Dec 20, 2010 IP
  4. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    #4
    Look through the external form style sheet and copy paste the actually form styles, things like: input and submit, over in to your web page style sheet, that's probable all you'll need

    EDIT: just to clarify, when your currently loading both style sheets, some of the styles are been overridden by the last style that loads. ie: duplicate styles
     
    Last edited: Dec 20, 2010
    MyVodaFone, Dec 20, 2010 IP