You probably are forgetting to style the new HTML5 elements as block-level elements. By default, browsers treat any unknown element as an inline element (display:inline
) which makes it difficult to do much with them.
Newer browsers are slowly treating the new HTML5 elements as stable, meaning they start giving them default styling like display:block
for the header
element, for instance. But, most browsers on the market today don’t have those default styles for HTML5 elements, so you’ll need to provide them.
Here’s a quick sample bit of CSS to do that:
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
display: block;
}
Adding that CSS to your main.css should fix your styling issue.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…