开发者

How do I tell an aside tag which side to go on?

I have an html5 aside开发者_JAVA百科 tag in a page I'm making. I can't find a way of telling it which side of the main article to be on?


<aside> is just a semantic enhancement of general <div> container - it does not carry any presentational (graphic) info with itself.

You have to style it with CSS in order to put it to some specific place in your layout. For example, with float: left property.


You have to do it through CSS, e.g. if you want your aside tags to be on the left you would do

aside { float:left; }


aside should not be used as a sidebar at all. Like the other answers say, it's a semantic enhancement that is similarly named but unrelated to a sidebar/sidenav.

For a sidebar, using div or section or nav (if it's a navigation sidebar) would be more correct.

Think of the aside element as your page talking directly to the viewer about content in the same parent element. Use it to enhance or showcase content in that parent. Like a shakespeare character talking to the audience. Pullquotes and piecharts in print magazines are good examples of asides.

For a sidebar, however, use section or nav and style it with css, floating it to one side or the other.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜