If you are a person who prefers to use <div> tags, this tutorial will be very suitable for you. this tutorial focuses on how to standardize HTML code to make it more meaningful. have you ever experienced a scenario like this: When editing others' templates, you find tags with unknown semantics and what do you feel like. after learning this tutorial, you will find that the Standard Code not only saves time For you to modify the code later, especially when you debug a large project, you will find that the original standard code is so useful.
1. Clear unnecessary <div> labels
Many people like to use <div> to wrap <form> and <ul> to create a menu list. have you ever wondered whether such a redundant <div> is required. you can use css rules to achieve the same effect.
Example 1:
This example shows how to delete <div> in <form>.
Example 2:
Sometimes we add an additional <div> label to the content to show that it is a content. in this example, <div class = "sidebox"> is used to include the content area. if a content has a title (for example,
2. Use a semantic tag
Use a semantic tag to compile your HTML document (for example,
Example:
This example demonstrates the benefits of using semantic tags.