Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

kent membreve
kent membreve
11,535 Points

php include and media queries or bootstrap implementation.

so I just discovered the wonder that is php include(), I have learned in the previous lessons about bootstrap and media queries how to make your website mobile compatible. now my question is, how will I incorporate a mobile compatible design while also using the php include()?

1 Answer

Hi Kent,

Bootstrap is a front-end framework. The CSS and Javascript can be loaded within your HTML-code. You don't really need to use PHP or it's function include for that.

A very basic example of that:

<html>
  <head>
    <title>Page title</title>

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" type="text/css">


    <!-- Custom CSS -->
    <link rel="stylesheet" href="stylesheet.css" type="text/css" media="screen">

  </head>
  <body>

    <h1>Your website content</h1>

    <!-- Maybe some Javascript like Bootstrap and jQuery -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

  </body>
</html>

Now within that template you could use PHP of course.

Hope this helps.