Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP Build a Basic PHP Website (2018) Building a Media Library in PHP Including the Header

Duc Duong
Duc Duong
8,670 Points

Index PHP file can't get the links to syle.css

When I execute the index PHP file on the MAMP localhost server, all the images and the style are lost. How can I fix this problem?

Can you please include your directory structure as well as at least the head area of your index.php file? Without those two details, it is going to be really hard to provide valuable insight.

Duc Duong
Duc Duong
8,670 Points

<head> <title>Personal Media Library</title> <link href="css/style.css" rel="stylesheet" type="text/css"> </head>

Corey Cramer thank you for your support. This is the head area of my file. It doesn't link to the css file with .php, but with .html it is ok.

1 Answer

Dennis Amiel Domingo
Dennis Amiel Domingo
14,805 Points

Did you copy/paste the project CSS files in your htdocs folder as well?