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

CSS

Martina Carrington
Martina Carrington
15,754 Points

center alignment

Hi everybody ! i have question, how do you centered a suggestion form. the code is correct i wondering if i alignment right ,

<?php $pageTitle = "Suggest a Media Item"; $section = "suggest";

include("inc/header.php"); ?>

<div class="section page"> <div class="wrapper"></div> <h1>Suggest a Media Item</h1> <p>if you think there is somthing Iā€™'m missing, let me know! Complete the form to send email.</p> <table> <tr> <th> <label for="name"></label></th> <td> <input type="text" id="name" name="name"/></td> </tr> <tr> <th> <label for="email">Email</label></th> <td> <input type="text" id="name" name="email"/></td> </tr> <tr> <th> <label for="name">Suggest Item Details</label></th> <td><textarea name="details" id="details"></textarea></td> </tr> </table> <input type="submit" value"send"/>

<form method="post">

</form> </div>

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

2 Answers

Martina, you can use CSS. Here's a link that discusses several ways to do it: http://www.w3schools.com/css/css_align.asp

Hey Martina. You would use CSS to center things. Just looking at you code, you have your wrapper <div class="wrapper"> closing and it actually isn't wrapping the rest of your code.

To center the h1 and p element, you could you the css property text-align: center; and that would center your title and text. Then for everything else you could try something like margin: 0 auto;

Not sure if that helps but hope it gets you started in the right direction!