shaijuelayidath Posted April 9, 2015 Share Posted April 9, 2015 Hello Friends, Recently i have read about 'main' tag is introduced in HTML5, but i could'nt found anywhere explained about the proper use of this tag. Means, everywhere explaining it is for main content of the website, but I would like to know that can we put 'section' and 'aside' tag within the 'main' tag. This is only i want to know. Thanks in advance! Link to comment Share on other sites More sharing options...
tejasamrute Posted April 9, 2015 Share Posted April 9, 2015 http://www.w3schools.com/tags/tag_main.asp http://html5doctor.com/the-main-element/ Link to comment Share on other sites More sharing options...
shaijuelayidath Posted April 9, 2015 Author Share Posted April 9, 2015 Hello Tezzo, Actually can I put 'section' and 'aside' tag inside of a 'main' tag. Because some are says 'main' tag is only for main content of the webpage and 'aside' tag is for secondary contents. So, 'main' and 'aside' tags are separate blocks which comes in a section or div. The links you have send is good but did you listen, there is no clearly says what elements can be contain by the 'main' tag. I searched few but nowhere is discussing about this term. Thanks! Link to comment Share on other sites More sharing options...
musakilimanjaro Posted April 9, 2015 Share Posted April 9, 2015 you need to read about the semantic web and semantic tags thats what the main, section, aside are all about. its about conveting some sort of meaning to search engines about how your content is arranged Link to comment Share on other sites More sharing options...
tejasamrute Posted April 9, 2015 Share Posted April 9, 2015 Note: There must not be more than one <main> element in a document. The <main> element must NOT be a descendant of an <article>, <aside>, <footer>, <header>, or <nav> element. Copied from w3schools link Link to comment Share on other sites More sharing options...
tejasamrute Posted April 9, 2015 Share Posted April 9, 2015 even i have had this discussion with my mates......and i have put the same point.... aside which is considered as a holding content to your main flow...why do you want to rate it<main>.......and if you think it is main you should include it in our main flow.... Link to comment Share on other sites More sharing options...
Ingolme Posted April 10, 2015 Share Posted April 10, 2015 The <main> tag is for content that is unique to the page. Headers, navigation and footers go outside the <main> tag, everything else goes inside it. Here's a basic HTML 5 document structure: <header><h1>Site name</h1></header><nav> <ul> <li><a href="#">Nav link</a></li> <li><a href="#">Nav link</a></li> <li><a href="#">Nav link</a></li> </ul></nav><main> <h2>Page title</h2> <section> <h3>Section 1</h3> <p>Content of section 1</p> </section> <section> <h3>Section 2</h3> <p>Content of section 2</p> </section></main><footer> <nav><!-- Perhaps a few footer navigation links --></nav> <p>Some more footer content</p></footer> Navigation tags can go inside or outside the <header> and <footer> elements, it doesn't matter. Link to comment Share on other sites More sharing options...
shaijuelayidath Posted April 10, 2015 Author Share Posted April 10, 2015 Hello Ingolme, Tezzo, musakilimanjaro, Basically I need a two column layout for content section. Please take a look at my following 2 HTML codes. Let me know No.1 or No.2 is right ? ---------------------------------------------------------------------------------------------------- No.1 ---------------------------------------------------------------------------------------------------- <main> <section> <-- main content goes here --> <aside> <--- subcontent goes here --> </main> ---------------------------------------------------------------------------------------------------- No.2 ---------------------------------------------------------------------------------------------------- <section> <main> <--- main content goes here --> <aside> <--- subcontent goes hee --> </section> ---------------------------------------------------------------------------------------------------- let me know which one can be use. Because nowhere is discussed about <aside> tag can be put inside of <main> tag. Thanks! Link to comment Share on other sites More sharing options...
tejasamrute Posted April 10, 2015 Share Posted April 10, 2015 i would go with 2nd....... Link to comment Share on other sites More sharing options...
Ingolme Posted April 10, 2015 Share Posted April 10, 2015 If the <aside> element has content that's unique to the page (in every page on your site something different is there) then you should put it inside the <main> tag. The <main> element should encompass everything that is unique to the page. Link to comment Share on other sites More sharing options...
tejasamrute Posted April 10, 2015 Share Posted April 10, 2015 i would give main tag to only that element which is most important on the page.....probably services section or a new product arrival on home page Link to comment Share on other sites More sharing options...
Ingolme Posted April 11, 2015 Share Posted April 11, 2015 You should read this article: http://www.sitepoint.com/html5-main-element/ 1 Link to comment Share on other sites More sharing options...
shaijuelayidath Posted April 12, 2015 Author Share Posted April 12, 2015 Hello Igolme, Its nice article which is a new thread for my doubt....Thank you Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now