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
Edwin Chau
Courses Plus Student 5,702 Pointssetting margins
Hi all,
I am trying to use html & css to create a forms, in the forms I have included first name, last name, email, and address. I used id to separated it, but i don't know why when I set margin in css I they move together, here is my code:
<!DOCTYPE html>
```<head>```
```<meta charset="utf-8">```
```<title> Contact Us</title>```
```<link rel="stylesheet" type="text/css" href="../css/styles.css">```
```<link href='http://fonts.googleapis.com/css?family=Nunito:400,300' rel='stylesheet' type='text/css'>```
```</head>```
``<body>```
```<form action="index.html" method="post">```
```<h1 id="contact">Contact US</h1>```
```<input type="text" id="first_name" name="user_first_name">```
```<input type="text" id="last_name" name="user_Last_name">```
```<input type="text" id="email" name="user_email">```
```<input type="text" id="street_name" name="street_name">```
```<input type="text" id="city" name="city">```
```<input type="text" id="province" name="province">```
```<input type="text" id="postal_code" name="postal_code">```
```</body>```
```</html>```
CSS
```body {background-color: lightblue;}```
```#contact {text-align: center;}```
```#first_name {margin-top: 100px;margin-right: 100pxfont-size: 20px;}```
2 Answers
Paul Anderson
15,056 PointsI'm not entirely certain what you mean by your question, but you're missing a semicolon after margin-right. This may be your issue. To help make it easier to spot errors like this you may want to format your code stacked like this.
first_name {
margin-top: 100px;
margin-right: 100px;
font-size: 20px;
}
Ryan Field
Courses Plus Student 21,242 PointsIn addition to what Paul stated above, you only need the three backticks (```) once before your code and once after, not at the beginning and end of every line. :)