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 Build a Basic PHP Website Listing and Sorting Inventory Items Displaying All Items

Josh Divis
seal-mask
.a{fill-rule:evenodd;}techdegree
Josh Divis
Python Development Techdegree Student 8,825 Points

Style is different than video

I haven't changed any of the CSS or the link to the file but mine shows each element on their own individual lines. Why isn't it styled to be on a 4x4 grid like Alena says and shows hers to be?

include ("inc/data.php");
$pageTitle = "Full Catalog";
$section = null;

if (isset($_GET["cat"])) {
    if ($_GET["cat"] == "books") {
        $pageTitle = "Books";
        $section = "books";
    } elseif ($_GET["cat"] == "movies"){
        $pageTitle = "Movies";
        $section = "movies";
    }elseif ($_GET["cat"]== "music"){
        $pageTitle = "Music";
        $section = "music";
}
}
include("inc/header.php"); ?>

<div class="section catalog page">
    <div class = "wrapper">
        <h1><?php echo $pageTitle; ?></h1>

        <ul class="items">
            <?php 
            foreach ($catalog as $item) {
                echo "<li<a href='#'><img src='" 
                . $item["img"] . "'alt ='" 
                . $item["title"] . "' />" 
                . "<p> View Details</p>"
                . "</a></li>";
            }
            ?>
        </ul>
    </div>
</div>

<?php include("inc/footer.php"); ?>

I have same query..

1 Answer

John Plastow
John Plastow
9,284 Points

Josh Divis You're missing the > on your opening <li> tag on line 26. I'm betting that's the cause of your grid issue. And although I doubt this is contributing to your issue, you've got a space between the alt attribute and its =. The space should be before alt instead. Also, you've got an extra space before "View" that could throw off your spacing by a few pixels.