In this article, we will learn how to add articles in HTML5.
One of the new segmentation elements in HTML5 is the
Let us consider the following example to understand how to add an article in HTML5
In the following example, we use inline styles in the post element.
<!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>
When the script is executed, it will generate an output showing the image uploaded using scr and the text used within the
Consider the following example, we are creating three separate articles with separate content.
<!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>
When you run the above script, it will generate an output containing the post tag text used in the script on the web page.
The above is the detailed content of How to add article in HTML5?. For more information, please follow other related articles on the PHP Chinese website!