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 8 of 8
  1. #1
    iez
    iez is offline
    New to the CF scene
    Join Date
    Aug 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    converting html to php, css not read

    Hi, I'm in the process of changing the html pages of my website into php. The problem I am having is when I change the .html to .php, the webbrowser stops applying the external css to the page. The external stylesheet is applied when it has the .html extension but not when I change it to .php.

    The external stylesheet is in the header as:

    <link rel="stylesheet" type="text/css" href="http://www.mysite.com/1/uti/main.css" />

    How do I get the css to apply to the website once it is changed from .html to .php?

    Thank you!

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    .PHP doesn't break a CSS load. The problem will be your output HTML. For that you'll need to check the HTML source to ensure that the proper path has been placed in it.
    Unless you mean that the .css has been converted to PHP (rare to do this), in which case you would load a .php file and best to push a header for a content type of text/css (although not really necessary).

  • #3
    iez
    iez is offline
    New to the CF scene
    Join Date
    Aug 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    only some of the css is not translating

    Maybe you can tell me what I am doing wrong, as it seems only some of the css is translating.
    [Links removed]
    Last edited by Fou-Lu; 08-30-2011 at 12:15 AM.

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    We better take those links out as this is not an adult friendly website.

    Check your source, you're PHP is repeating the starting <html> section twice in the code. The body itself is not repeated, but I'm willing to bet that'll be a large part of the problem.
    The HTML you have in here is quite old as well. Use the validator at validator.w3.org to verify the HTML to doctype in use. There is also a css validator on their website to ensure that the CSS is also standards compliant.

  • #5
    Regular Coder dniwebdesign's Avatar
    Join Date
    Dec 2003
    Location
    Carrot River, Saskatchewan
    Posts
    842
    Thanks
    15
    Thanked 9 Times in 9 Posts
    Quote Originally Posted by Fou-Lu View Post
    We better take those links out as this is not an adult friendly website.
    Sorry for straying off topic but it's "not an adult friendly website"? So it's kid friendly? Or do you mean it's not "Family Friendly"?
    Dawson Irvine
    CEO - DNI Web Design
    http://www.dniwebdesign.com

  • #6
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Quote Originally Posted by dniwebdesign View Post
    Sorry for straying off topic but it's "not an adult friendly website"? So it's kid friendly? Or do you mean it's not "Family Friendly"?
    Yeah I was confused when I read that too. I guess Fou-Lu was blinded by his newly acquired 5 digit post count.

    The links that were posted were to an adult orientated website. What I think Fou-Lu was trying to say was: Those kinds of links aren't allowed since CodingForums is a family friendly place. And we have some members that are young.

    The OP can still get help though.
    OracleGuy

  • #7
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Oops, I actually meant not an 'adult website friendly forum'. Lol. You got what I meant so its all good.

  • #8
    iez
    iez is offline
    New to the CF scene
    Join Date
    Aug 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    THanks

    Thanks for the reply! Sorry for the links, I guess I wasn't thinking, sorry if I offended!


  •  

    Posting Permissions

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