how to use html 5 tag for images rather

2019-05-11 20:04发布

问题:

I'm redoing the html my team has been working on.. and i was wondering if I can modify html 5 tags. Specifically I would like to use the tag for images rather than tables..

in w3schools:

*Definition and Usage: The <caption> tag defines a table caption. The <caption> tag must be inserted immediately after the <table> tag. You can specify only one caption per table. Usually the caption will be centered above the table*.

How can I strip this tag from all these requirements?

回答1:

I think what you're after is the <figure> and <figcaption> tags, used to annotate images like you see in textbooks and the like. Caption is specifically for tables.