Comments
In HTML, comments are used to add notes or remarks to your code that are not displayed in the browser. Comments are useful for documenting your code, providing context or instructions for other developers who might work on the same project, or temporarily disabling parts of your code.
To add a comment in HTML, you can use the <!-- and --> tags. Anything enclosed within these tags will be treated as a comment and ignored by the browser. Here's an example:
<!-- This is a comment. It will not be displayed in the browser. -->
You can also use comments to temporarily disable parts of your code. For example, you might want to remove a section of your code to see how it affects the rest of your page, but still want to keep the code for reference. You can comment out the section by enclosing it within <!-- and --> tags, like this:
<!-- <p>This section will not be displayed.</p> <p>But it will be saved for later reference.</p> -->
Horizontal line
In HTML, a horizontal line can be inserted using the <hr> tag. The <hr> tag creates a horizontal rule that is used to visually separate content on a web page.
Here's an example of how the <hr> tag can be used to create a horizontal line:
<!DOCTYPE html> <html> <head> <title>My Web Page</title> </head> <body> <header> <h1>My Web Page</h1> </header> <main> <section> <h2>About Me</h2> <p>My name is John Doe and I am a web developer. I have been working in the field of web development for over 5 years, and have experience with HTML, CSS, JavaScript, and other web technologies.</p> <p>In my free time, I enjoy hiking and photography.</p> <p>Contact me at john@example.com or follow me on Twitter @johndoe</p> <hr> <h2>My Projects</h2> <p>Here are some of the projects I have worked on:</p> <ul> <li>Project 1: A responsive website for a local restaurant</li> <li>Project 2: An e-commerce website for a clothing store</li> </ul> </section> </main> <footer> <p>Copyright © 2022 My Web Page</p> </footer> </body> </html>
<hr> tag is used to separate the "About Me" section from the "My Projects" section with a horizontal line. This makes it easier for the reader to distinguish between the different sections of the page.Bold italic underline
<i> and <em> tags: Both of these tags can be used to make text italic. The difference between them is that the <em> tag is used to indicate emphasis or importance, while the <i> tag is used purely for stylistic purposes. For example:<u> tag: This tag is used to underline text. For example:<strong> instead of <b> if the text is truly significant or important, and use <em> instead of <i> if the text is meant to be emphasized or highlighted for a particular reason.
Comments
Post a Comment