在本文中,我們將學習如何在 HTML5 中新增文章。
HTML5 中的新分段元素之一是
讓我們考慮以下範例來了解如何在 HTML5 中新增文章
在以下範例中,我們在文章元素中使用內聯樣式。
<!DOCTYPE html> <html> <body> <article style="width: 300px;border: 2px solid gray;padding: 10px;border-radius: 10px;margin: 5px;"> <img src="https://www.tutorialspoint.com/static/images/logo-color-footer.png"alt="image" style="max-width:90%" style="max-width:90%"class="alignnone size-medium wp-image-560930"/> <h1>TutorialsPoint</h1> <p>Tutorials Point originated from the idea that there exists a class of readers who respond better to online content</p> </article> </body> </html>
執行腳本時,它將產生一個輸出,顯示使用 scr 上傳的圖像以及網頁上
考慮以下範例,我們正在創建三篇獨立的文章和獨立的內容。
<!DOCTYPE html> <html> <body> <article> <h1>MSD</h1> <p>Mahendra Singh Dhoni is an Indian former professional cricketer who was captain of the Indian national cricket team in limited-overs formats</p> </article> <article> <h2>YUVI</h2> <p>Yuvraj Singh is a former Indian international cricketer who played in all formats of the game. He is an all-rounder who batted left-handed in the middle order</p> </article> <article> <h3>SREYAS IYER</h3> <p>Shreyas Santosh Iyer is an Indian cricketer who plays for the national side in international cricket, Mumbai in domestic cricket</p> </article> </body> </html>
在執行上述腳本時,它將產生一個輸出,其中包含網頁上腳本中使用的文章標籤文字。
以上是如何在HTML5中加入文章?的詳細內容。更多資訊請關注PHP中文網其他相關文章!