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 Smith
3,596 PointsPage doesn't match Randys
My page doesn't match randys the price and paragraph are underneath the image instead of the right hand side
<?php include("inc/products.php");
$product_id = $_GET["id"];
$product = $products[$product_id];
$section= "shirts";
$pageTitle = $product["name"];
include("inc/header.php"); ?>
<div class="section page">
<div class="wrapper">
<div class="breadcrumb"><a href="shirts.php">Shirts</a> > <?php echo $product["name"] ; ?></div>
<div class="shirt-picture">
<span>
<img src="<?php echo $product["img"]; ?>" alt="<?php echo $product["name"]; ?>">
</span>
<div class= "shirt-details">
<h1><span class="price">$<?php echo $product["price"]; ?></span> <?php echo $product["name"];?></h1>
<p class="note-designer">* All shirts are designed by Mike The Frog.</p>
</div>
</div>
</div>
<?php include("inc/footer.php"); ?>
What have I done wrong?
1 Answer
thomascawthorn
22,986 Points<div class="shirt-picture">
<span>
<img src="<?php echo $product["img"]; ?>" alt="<?php echo $product["name"]; ?>">
</span>
<div class= "shirt-details">
<h1><span class="price">$<?php echo $product["price"]; ?></span> <?php echo $product["name"];?></h1>
<p class="note-designer">* All shirts are designed by Mike The Frog.</p>
</div>
</div>
Above you have the shirt-details div inside the shirt-picture div. Shouldn't you have the shirt-details div next to the shirt-picture div?
<div class="shirt-picture">
<span>
<img src="<?php echo $product["img"]; ?>" alt="<?php echo $product["name"]; ?>">
</span>
</div>
<div class= "shirt-details">
<h1><span class="price">$<?php echo $product["price"]; ?></span> <?php echo $product["name"];?></h1>
<p class="note-designer">* All shirts are designed by Mike The Frog.</p>
</div>
If not, then it's likely to be a css problem
Mike Smith
3,596 PointsYes, I was missing the closing div tag from the shirt-picture, looks good now thanks!
Fidel Torres
25,286 PointsFidel Torres
25,286 PointsHello Mike Smith
Can you pls add a screenshot of your page, THANKS