Welcome to the Treehouse Community
Looking to learn something new?
I am trying to put my text and the images in the center of the page just like in the video "Working with Grids" and it doesn't work. I am using the same code as in the video <body> <div class="container"> </div> </body>. I also have placed the link in the "head" tag for the grid: <link rel="stylesheet" href="css/grid.css" type="text.css" media="screen>. And also I indented my text. Can anyone tell me what I did wrong?
Guys, I used inside the div putting style too, text-align: center and it works. Thank you for your support. I learned some stuff!
use a site like codepen.io to show your work... then we will help you.
Are you using the
property for it?
I put code in my video also, but it went away.
There is a link to my work, it's the html and the grid.css. I also have the normalize.css bu I saw there is only one section to put a css file so I put just the grid. No I haven't used the text-align: center. How can I display what I do just like you did Erik Montes?
First of all, your html format is not correct. In your gist you have the img tag in the head, which should be in the body. Also the media attribute value needs quotes on both sides not just one:
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <img src="img/logo.gif" alt="Logo"><!-- Needs to go in the body, not here in head --> <link rel="stylesheet" href="css/normalize.css" type="text.css" media="screen><!-- needs to be "screen" not "screen --> <link rel="stylesheet" href="css/grid.css" type="text.css" media="screen> <!-- also needs to be "screen" not "screen --> </head>
A lot of the times having improper HTML tags and such will cause things to act weird. So try fixing that just to make sure that's not the culprit.
I've added the answer to your gist:
- you haven't closed your media attribute's value
- you've used a wrong type attribute in them, too.
try them out and center your text. There is another centering which contains adding margin of 0 & auto to a well-defined width of container.
I closed my media attribute, still doesn't work.
"also we have a tag and a tag. don't include an in ... It's apples and oranges. ;)"
what's an in?
And also is it wrong to use to .css files? It's as directed by treehouse..
I forgot to add Markdown style!
Now It's fixed!
How do I add markdown style?
happy to hear that. ;)