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 trialMike Hansen
Python Web Development Techdegree Student 3,419 PointsCss is weird both places now..
So now the css where the books/music/movies are is weird both places now, so i tried to download the Project Files but it didn't help at all. Here's my code for index.php:
<?php
include("inc/data.php");
include("inc/functions.php");
$pageTitle = "Personal Media Library";
$section = null;
include("inc/header.php"); ?>
<div class="section catalog random">
<div class="wrapper">
<h2>May we suggest something?</h2>
<ul class="catalog">
<?php
foreach ($catalog as $id=>$item) {
echo get_item_html($id,$item);
}
?>
</ul>
</div>
</div>
<?php include("inc/footer.php"); ?>
and catalog.php:
<?php
include("inc/data.php");
include("inc/functions.php");
$pageTitle = "Full Catalog";
$section = null;
if (isset($_GET["cat"])) {
if ($_GET["cat"] == "books") {
$pageTitle = "Books";
$section = "books";
} else if ($_GET["cat"] == "movies") {
$pageTitle = "Movies";
$section = "movies";
} else if ($_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>
<?php
foreach ($catalog as $id=>$item) {
echo get_item_html($id,$item);
}
?>
</ul>
</div>
</div>
<?php include("inc/footer.php"); ?>
2 Answers
Jason Anello
Courses Plus Student 94,610 PointsHi Mike,
The css file you have is probably expecting the ul class to be "items". This is the class that is shown in the previous video for the catalog page.
<ul class="items">
Make sure you have this on both your index page and catalog page. Post back if that didn't solve the styling issues.
Mike Hansen
Python Web Development Techdegree Student 3,419 PointsHi jason,
That did work thank you so much! :)
Ben Os
20,008 PointsBen Os
20,008 PointsI have this class in the ul tags in both index.php and catalog.php but my items look like a long html list and there is no css in the site...
No errors...
Jason Anello
Courses Plus Student 94,610 PointsJason Anello
Courses Plus Student 94,610 PointsHi Ben,
If you're doing this in workspaces can you post a snapshot?
No css is being applied to any part of the site?