的作用是什么和元素?它们为何被引入?
元素 <section> 和 <article> 也对屏幕阅读器很有用,同时可以帮助视障用户阅读网页内容。这对电子书阅读器也有好处。
让我们看看如何使用这两个元素。
<section>
<!DOCTYPE html> <html> <head> <title>HTML Section Tag</title> </head> <body> <section> <h1>Java</h1> <h3>Inheritance</h3> <p>Inheritance defines the relationship between superclass and subclass.</p> </section> </body> </html>
<article>
<!DOCTYPE html> <html> <body> <main> <h1>Learning</h1> <p>Learn to gain experience and try to share your knowledge with others.</p> <article> <h3>Web Development Tutorials</h3> <p>Consist of CSS, HTML, and PHP tutorials for 2nd Semester exams.</p> </article> <article> <h3>Academic Tutorials</h3> <p>Consist of Computer Fundamental, Computer Network tutorials for 1st Semester exams.</p> </article> </main> </body> </html>
广告