HTML has tried to remove representations and develop towards content, leading to the following basic principle: separating content meaning (HTML) from representations (CSS ). This will cause weight loss on the webpage, because a set of presentation commands (in the form of external CSS documents) can be applied to multiple pages. This also makes the website easier to manage because global changes can be obtained from modifying a separate file. Some bad HTML has tried to remove the performance and orientation of the content, leading to the following basic principle:
Performance(CSS) separated
Meaning(HTML ). This will cause weight loss on the webpage, because a set of presentation commands (in the form of external CSS documents) can be applied to multiple pages. This also makes the website easier to manage because global changes can be obtained from modifying a separate file.
Some poor labels are basically performance labels (such
small
), They can be replaced by more meaningful and simpler CSS rules. Others are not only used for performance, but also not necessary to be huge (for example
font
Tags) or the type that is harmful to availability (for example
blink
). Tag
The following are some of the tags you may often encounter that have better options:
b
It can be used to generate bold elements. Use
strong
(Meaning strong emphasis) instead of more meaningful, or use CSS to do this, increase
font-weight: bold
To indicate the bold elements.
i
It can be used to generate italic elements. Use
em
(Emphasize), which is more meaningful. You can also use CSS to show italics:
font-style: italic
big
A larger font can be generated. Use the title (for example
h1
,
h2
When the text is originally a title) instead, it adds meaning, or simply uses it in CSS
font-size
Property to obtain more control.
small
Small fonts can be generated. CSS (
font-size
.
hr
It can be used to display a horizontal line. Used in CSS
hr
The design is rare.
border-top
,
border-bottom
Attribute or plain image will do better.
Although the above tags are compatible with the latest HTML standards, they do not have any meaning for the content. They cocould be more useful but they aren't Special harmful, and might easily be mistaken for innocent butter-wouldn't-melt-in-their-mouth nuggets of pure goodness when standing next to the following filthy tags.
u
Underlines can be generated for elements. It reminds you that there are still many connections in the underlined text. That's why the label has been dead for a long time-you don't have to underline non-connection text.
center
Elements that can be centered inside the element. CSS attributes
text-align
Not just
center
And
left
,
right
And
justify
.
menu
Used to create a menu list. It does not
ul
Perfect because Unordered Lists are more common,
ul
High ground stands on the body of menu.
layer
And
p
Elements are similar to each other, and they are all placed at the top of the CSS. This can only work in earlier versions of Netscape, so it is no longer useful.
blink
Or
marquee
. Say NO! They should be expected as they mean, but have very limited support, and only produce very, very disgusting jokes.
font
Can be used to define the font name, size, and color of an element. In the world of tags, the title of King of notorious tags is taken for granted. The old websites (and even new ones) are filled with the whole page like the ant of the plague in the world. Most
font
The surge in tags comes from the creation of web pages.
font
Labels include colors and dimensions used in each element.
font
Tags are abused to appear in every duplicate element (for example, each time you use
p
CSS, you can use a short code to apply duplicate elements, or even control the entire website. The CSS method can not only increase the number of pages
font
Label parasitic
SlimAnd it is easier to maintain because all you need to do is change
One rowInstead of modifying each
font
Label. This also increases the possibility of maintaining a website consistent with the design style.
font
The use of tags and inappropriate tables is the main reason why the web pages do not need to be bloated. Attribute
Maybe you think you are using good labels, but there are still some troublesome parasitic properties lurking, they will come out at any time.
name
Used to specify a name for an element.
input
The form element is completely accepted, but elsewhere,
name
The job has been
id
Replace attributes.
text
And
bgcolor
You can
body
The start label defines the basic text color and background color of the page. CSS
color
And
background-color
Attribute applied
body
You can also select a token.
background
You can specify a background image in the body tag. CSS performs better, and uses attributes such as background-image to process background images.
link
,
alink
,
vlink
In
body
Tags are used to specify connections (unaccessed, activated, and accessed ). CSS baby ──
:link
,
:active
And
:visited
Will do the work.
align
It can be used to align the content of an element (for example
Stuff
), But, like
center
Tag, CSS
text-align
Attribute is the new boss.
target
You can open a connection in different ways. The most common is to open a new window (for example
Help me
). It looks good, but you should not do this to your website. What you don't expect (such as a new window) appears, and the most common browser tool is the browser's back button. If you open a new window, this will be unavailable. It is neither feasible nor easy to use. Note:
Preserve the performance attribute of the tag.
width
And
height
, Table
cellpadding
And
cellspacing
, Because these elements often use different values. This is not a perfect solution, but if your webpage has a large number of images and tables, you have no other wise choice, so you have to use them.
The most incomprehensible performance attribute is
textarea
Tag, which has only
cols
And
rows
Two Valid attributes are required in the latest HTML version. Good labels and poor use
To enter your bedroom, you can bend over through a dog hole, but wait, there's a door with a hand ready for humans! Wow, look -- it's just right for one entry.
Use HTML tags (good tags), whether Believe It Or Not (believe it !), There is a good reason: You have a good premise to use them, and you will have a better result.
The web page itself is easier to use than the syntax and semantics of HTML tags.
ul
Tag or has
h1
Or
h2
Highlight them.
In the HTML Tag world, tables are the most abused. Tables are often used for layout, but tables should only be used to display table-type data, just like their design intent. The layout method without tables is not a kind of zen in the pursuit of enlightenment. It can not only significantly reduce the size of webpages, but also make it easier to maintain and redesign. Note:
Sometimes Hou designers will use the labels and attributes mentioned here (especially for table layout)
Transition typeDesign-it can work on older browsers (especially Netscape4) or modern browsers. The table does have stronger performance control on the incompetent CSS Netscape4. Unfortunately, there are few and fewer users, and more users are showing the disadvantages of table layout. The aforementioned table-free design can prevent these shortcomings. Although a small number of users may experience significant performance changes
AllBrowsing maintains full functionality. Framework
Goldilocks thinks drinking a cup of porridge is a good note, but three huge meat mammals suddenly appear, throwing her out of the window. The frame is a cup with porridge. They seem good, but they are now endangered and will soon disappear.
Most websites do not use a framework, but users generally take a document as a page.
In some cases, if you want to prevent users from adding specific webpages to bookmarks, or if you want users to recommend specific webpages through Email or instant chat software, or you want to make the entire website very complex, so that screen reader users can frequently operate between frames, or you want to confuse the search engine. That's enough. You can use the framework!
In short, the framework will only
Increase complexityAnd
Availability loss. Note:
As long as you follow the following rules, you will not have a future in making mistakes:
1)A tag or attribute only has a few
PerformanceDo not use it. That's about CSS. And CSS is better.
2)Use tags in
Name suggestion. Table labels are used on table data. The title label is used on the title. And so on.
3)For specific content
Appropriate. List
list
, The title uses hx (x = 1-7) and so on. Standard points for further reading of the HTML advanced guide: getting rid of bad habits and turning to standards-compatible with XHMTL