HTML classes and IDs are not only important for hard coded programs. Finally, you no longer need to be a web developer. Instead, you can get almost everything by dragging and dropping or clicking a mouse button. Its ability is a big part of the success of WordPress. With this platform, ordinary people can also build highly professional websites. However, if you want to learn more about custom themes, you do not need to learn about annotations and code. With practical knowledge of HTML, CSS, PHP, and increasingly JavaScript, you can perform any task you need on your site. For this reason, we want to see the core HTML classes and IDs for all word press topics in this post. Next, you will learn what they are, why they are important, and how to use them correctly. Changing the WordPress site across the board is very helpful. The
Before understanding HTML classes and IDS, it is necessary to be familiar with how HTML works. If you use WordPress, the default HTML building block, you may have viewed the template file before. In this way, you can see something very similar to the following: The word press template file is written in PHP, but it also contains a lot of HTML. For example, there are many standard HTML elements: Male – displays a larger part of the page. Header, content, sidebar, and footer elements are often used to consist of a box. However, nowadays, semantic annotations such as male, male, male or male are generally used. Other elements can also be nested in the div box. Male ~ male – this is the so-called title tag. As indicated by the name, it is used to provide the title or subtitle of the content structure. For more information, see the full article on this topic. Male – used for standard operation content. P stands for \
Male
Male
Male
Male my HTML test site male
Male
Male
Male
Male
Male my HTML test site title male
Male
Male
Move to the first project
Male lorem Ipsum Dolor sit AMET, dissectetur advertising elit Sed convallis ELISA in Massa postuere sagittis Male Maecenas tincidunt male, Nisi EU ullamcorper eleifend, sapien Magna suscipit Dolor, non effective Tellus Ipsum sed quam Utulamcorper Leo sent by Prae. Male nullam luctus Semper Massa male, Quis porttitor Dui malesuada AC
Male vestibulum sapien purus, placerat sed diam UT, malemattis dapibus lorem Essence tempers, lacinia odio AC, pellentesque Massa essence. Prolin Mattis cultures tor, vitae rutrum enim commodo AC. fusce placerat nibh at tincidunt facility Phasellus auditor Semper MI, malenec condimentum Justo fermentum ID male Pellentesque suscipit libero Quis nisl interdum viverra Male
Male
Male UT
Sapien Leo, Semper EU nunc eget male
Male pulvinar vulputate mi
UT imperite aliquat
Male Quis pharetra nibh cursus sed male
Male Mauris Tempus Mauris non metus rutrum male
Male
Male etiam pulvinar Magna sit AMET tincidunt orne Male nunc NEC Dolor sit enim Congue dictum male Vivamus ut feugiat neque, a Fringilla nulla Nunc tincidunt vehicula porta Phasellus AC Semper tellus Vestibulum a lectus facility erat scelerosque aliquet et rhoncus nisl Male
Male
Male
1991-2004 Vintage Web Design
Male
Male
‹ browser display: The
Male very bare handed, I know. But this is what the site was originally like. That makes things complicated. With the increasing demand for website representation, the complexity of HTML is also increasing. The latest version of the annotation language contains additional functionality for specifying document styles. In this way, the final product looks better, but the subsequent code reading and writing become more complex. The main reason is that all styles must be included in the row (). In the above example, you can see: Male
Male
Male
Male my HTML test site male
Male
Male
Male
Male
Male my HTML test site title male
Male
Male
Move to the first project
Male lorem Ipsum Dolor sit AMET, dissectetur advertising elit Sed convallis ELISA in Massa postuere sagittis Male Maecenas tincidunt male, Nisi EU ullamcorper eleifend, sapien Magna suscipit Dolor, non effective Tellus Ipsum sed quam Utulamcorper Leo sent by Prae. Male nullam luctus Semper Massa male, Quis porttitor Dui malesuada AC
Male vestibulum sapien purus, placerat sed diam UT, malemattis dapibus lorem Essence tempers, lacinia odio AC, pellentesque Massa essence. Prolin Mattis cultures tor, vitae rutrum enim commodo AC. fusce placerat nibh at tincidunt facility Phasellus auditor Semper MI, malenec condimentum Justo fermentum ID male Pellentesque suscipit libero Quis nisl interdum viverra Male
Male
UT sapien Leo, Semper EU nunc eget
Male pulvinar vulputate mi
UT imperite aliquat
Male Quis pharetra nibh cursus sed male
Male Mauris Tempus Mauris non metus rutrum male
Male
Male etiam pulvinar Magna sit AMET tincidunt orne Male nunc NEC Dolor sit enim Congue dictum male Vivamus ut feugiat neque, a Fringilla nulla Nunc tincidunt vehicula porta Phasellus AC Semper tellus Vestibulum a lectus facility erat scelerosque aliquet et rhoncus nisl Male
Male
Male
Old website 1991-2004
design
Male
Male
Through it, the output looks very different from before. The
The disadvantage is that if you want to change the design or reuse the style of other elements, you must view the entire page (or multiple pages) and modify all instances separately. Especially for repeated elements (such as links), this can be really annoying very quickly. So what should we do? The emergence of CSS or cascading style sheets is a major stage in the development of style sheet websites. This makes no sense except to include all annotations of the style in the page document, unless it is placed in a separate file. In this way, the structure and display of the page can be handled separately. The
In the example above, the style sheet is as follows: HTML{
Font family: sans serif;
Color: \666;
}The
body
Background color: \f6f6f6;
Blank: 0 automatic;
Maximum width: 1050px;
}The
H1{
Color: \3eb9c8;
Font size: 40px;
}The
H2{
Background color: \111d2f;
Color: \ffffff;
Display: inline;
}The
The{
Color: \eb6126;
Text decoration: none;
}The
Header{
Down jacket: 30px0;
}The
Footer{
Text alignment: Center;
}You can then return to the simpler page version above. Just add the following lines in the ○ section of the page to invoke the style sheet. The
After that, the page maintains its style. This is because the browser can import from the style sheet instead of reading the annotations for each element individually. This greatly reduces the complexity of writing HTML. That is, if you change the style in the center, all elements change at once. In addition, it can work on all pages that invoke the stylesheet in mind. Is it more practical? The
But there are still problems. How do I assign different styles to elements of the same type? Attached to move back row? No, that’s where the class and Id go. What are HTML classes and IDS? Class and ID are hooks that can be assigned to HTML elements to make them more concrete. Specifies an additional identifier for CSS annotations. For example, suppose you want to change the font size of my copyright text (but leave other text in the footer the same size). You can simply do this by specifying the ID: The
When designing old-fashioned web pages from 1991 to 2004, you can use the \\s prefix to assign several special CSS to this ID# Copyright – text{
Font size: 13px;
}The results are as follows: The course is conducted in a similar way. For example, suppose that there are multiple male boxes about subassemblies in the sidebar, and you want to change the style. If my sidebar already has an ID (for example, \main-sidebar), you can theoretically specify the box as the target:# Main sidebar div{
\/*Enter style here**
}But it also includes other divs. Therefore, it is wiser to provide your own classes for the assembly container. The
Male
Male
Male
Male
Male
Male
Male
In this way, the style of the corresponding box can be changed, and the rest can be retained# Main sidebar Widgets{
\/*Enter style here**
}Easy to understand? In addition, classes replace hash symbols. In front of them. Topic hooks have a similar concept. They work like classes and IDS because they can attach functionality rather than CSS. To learn more about topic hooking, please check the beginner’s Guide. The
HTML classes and IDS – when and what? So how do you use class and ID appropriately? The first point to pay attention to
Insert*\/
Is it easy? But it’s just as important as knowing when you shouldn’t use classes and IDS. There are many HTML selectors, which can be directly targeted together with male, male and ~ male. If you need to specify a single style (for example, a post title), it is recommended that you only provide additional selectors for it. So before you go to class or do ID, please think about it. In short, HTML classes, ID classes, and IDS can apply CSS styles in a more objectified way. Learning how to use correctly is an important step in understanding, creating, and modifying word press topics. In this article, we discussed what HTML classes and IDs are and how to create web designs more easily. This knowledge is helpful not only to customize your own website, but also to understand the structure of other websites or topics. On either side, understanding classes and IDS is an important skill for everyone working in the digital world. This is also a very simple concept. They will soon become your second nature, and I promise you you won’t want to live without them. How do I use HTML classes and IDS? Do you have anything to add to the above? Please inform the comments section below.