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 trialShay Paustovsky
969 PointsAm I writing proper HTML?
So I had this question inside my mind for a long-time. During HTML courses I would write notes in my notebook & then copy them to my text editor and create a simple HTML web page. I know what semantic meaning every element conveys but when writing code, it feels so weird because I feel I'm doing something wrong?
3 Answers
behar
10,799 PointsI am not exacly sure what you are asking. Are you writing code correctly? If the page works i guess you are. However i think its good to remember that quite alot of what html is, is just titles and ways of structuring your webpage, not so much how it looks. For instance say you put some stuff inside of a <footer> element. Well the footer element is really going to mean very much for the webpage itself, seeing as you will style it in css, and make it interactive in Javascirpt. However having that footer element will make it easier to target that specific thing in the styling of the page. Also it will help things like screen readers understand the page. Im not sure if this was the answer you were looking for, but it was what came to mind when i saw your question.
Shay Paustovsky
969 PointsThank you for the quick response behar, Sorry let me rephrase my question: I meant that I don't feel confident about semantic elements like : article, section, aside, nav and where to use them. When writing the code I feel It's in the wrong place and the wrong context.
behar
10,799 PointsAhh well, this is totally normal, if your new to html, and havent done alot of stuff with it, it can be challenging to know if your using the different tags correctly. I think this is just trail and error. However if your completely new to programming i would strongly recommend that you take some courses in CSS or Javascript. This will require you to actually style and interact with some of your tags. I belive this will reinforce wether your doing it right or wrong. However as i explained earlier alot of tags in html dosent require that you use them. For example inside a <nav> element, you would put things for navigation, like links. But html wont punish you for not putting a nav tag. But imgine that you have some links at the bottom of your page, they are placed inside <nav> elements. Now instead of assigning an id or a class to all of those links, you could simply target the <nav> element in your style sheet. So html is very much just about the structure of your page, and trying to make it easier to code later. Seeing as you already have 1000+ points on html, i would recommend that you move on to either CSS or Javascript now, there you will actually have to target specific elemnts on an html document, which should reinforce your knowleagde in html. I hope this helps!
Shay Paustovsky
969 PointsThanks so much behar.