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 Listing and Sorting Inventory Items Displaying Item Details

Ryan Lucas
Ryan Lucas
6,946 Points

Bootstrap to make the site responsive to size do not work for the basic PHP website, Personal Media Library. Why?

Hello there!

I have built the basic PHP website (Personal Media Library) and I just wanted to make it responsive, resizing to mobile screens and other sizes, so I thought a quick fix would be to copy paste the bootstrap cdn links into it. I have tried this but they have no effect what so ever. I uploaded the site live on a web server here with bootstrap css included in the head and bootstrap javascript in the end of the body if you want to see. http://www.ryanlucas.co.uk/xyz/

I just wondered if anyone would be able to shed some light on why this doesn't work, or if I have made a mistake somewhere?


1 Answer

John Plastow
John Plastow
9,284 Points

Ryan Lucas For one thing, the <head> is missing a viewport meta tag. Secondly, there are 22 instances of hard-coded widths in the CSS which aren't flexible enough to be responsive. Simply slapping Bootstrap in won't override that. You'd have to rewrite all that to make it work. Keep in mind this is just a demo project and not intended to be as complete as a website for the public should be.