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
Brad Sprague
5,523 PointsCSS formatting in "Build a Basic PHP Website" project
In the project for the "Build a Basic PHP Website" course, the formatting in my catalog pages does not match the video. It appears that the images are not re-sized.
The relevant PHP is as follows:
<div class="secton catalog page"> <div class="wrapper"> <ul class="items">
<?php ...
foreach ($categories as $id) {
echo get_item_html($id, $catalog[$id]);
} ?>
</ul> ...
The function call to get_item_html() produces the HTML for the list items and gives the desired resized result on the index.php page. So I don't think the problem is there.
The CSS file contains the code below (it was supplied, I did not write it):
.section.catalog ul.items li img {
width: 190px;
border: 6px solid #f0eeed;
}
It seems like the right classes are there, but this CSS code is not being applied. How might I go about determining where the problem is?
Brad Sprague
5,523 PointsRegarding the comment by Tobiasz Gala: Thank you so much! You have no idea how long I spent pondering CSS rules when the problem was a simple typo!
I'd check your response as the best answer, except there is no option to do that.
2 Answers
jcorum
71,830 PointsYou have
<div class="secton catalog page"> <div class="wrapper"> <ul class="items">
<?php ...
foreach ($categories as $id) {
echo get_item_html($id, $catalog[$id]);
} ?>
</ul> ...
You need class="section ..." instead of class="section ..."
Brad Sprague
5,523 PointsI think you meant to say, You need class="section ..." instead of class="secton". (The 'i' is missing in the original code). Thank you so much for answering! That is, indeed, the problem.
jcorum
71,830 PointsYes, good eye!
Tobiasz Gala
Full Stack JavaScript Techdegree Student 23,529 PointsTobiasz Gala
Full Stack JavaScript Techdegree Student 23,529 Points<div class="section catalog page">You forgot about "i"