Since the W3C established the Xhtml1.0 standard, many websites have begun to use it to reconstruct their sites, such as yahoo, 163, CSDN, etc. The craze of Xhtml+CSS2 has been increasing in recent times, so occasionally I also started to learn them, and gradually fell in love with them. Now let’s talk about my learning experience in the recent period.
Why you should learn Xhtml+CSS2
First of all, standardized code can be displayed smoothly in various browsers.
Some web pages with non-standard codes can be displayed normally in IE, but they may not be displayed properly in Firefox and Opera. Although the current mainstream browsers are IE and various browsers with IE as the core, we do not rule out the gradually increasing user base of browsers such as Firefox and Opera, and most of these groups are veterans who are more proficient in computers. I think it would be a bad feeling if they scolded their website for being rubbish, haha.
Of course, this does not mean that web pages made using tables, etc., do not meet the standards. It is just that many people are currently accustomed to using Forntpage or Dreamweaver for design. These visual software are convenient, but they also bring many problems. , these software will more or less automatically add or subtract some codes. If you don't have the habit of checking the code, it can easily lead to irregular codes.
Secondly, DIV + CSS2 makes page layout simpler
It is said to be Xhtml+CSS2, but in fact, DIV+CSS2 is more often used to build a website. If you have used a lot of nested tables to layout or set up a page before, you usually divide a page and use cells to describe areas. This is more intuitive in software such as WYSIWYG, but it has some effects. There are several aspects. First, it may affect the download speed. Secondly, for handwritten code, such a structure is very unintuitive. In addition, one of the involved areas is the merging of cells. If you accidentally make a mistake with a colspan="?", Then the layout of the entire page will be completely different.
Using CSS for layout is just like operating layers in PS, because there are relative and absolute concepts in CSS, haha, it makes page layout easier and more convenient.
In addition, Xhtml can reduce the file size
Although the Internet speed is getting faster and faster now, who doesn’t want their site to be faster? Someone once said, “The furthest distance in the world is not the earth. to the sun, but from China Telecom to China Netcom." If your site on the telecom server is browsed by users of Netcom lines, the web page file size will inevitably affect the viewer's experience. Using Xhtml will help you solve this problem, haha.
In view of the above points, I gradually became accustomed to using Xhtml+CSS2 to build websites.
Experiences during learning
Code writing tools: Since there are no visual tools to write Xhtml+CSS2 pages, it is necessary to find a code writing tool that suits you. I have been I am using Editplus, and I recommend it as you recommended it. For some tips on using Editplus, you can read here:
http://www.ifess.com/?p=23
Page layout structure: A page must first have an overall layout, such as header, menu, sidebar, content, footer, etc., by defining the CSS attributes of these elements to give the page an overall division, and then write specific details in these elements. content so that the page doesn’t look cluttered.
CSS writing method: In a project, the attribute values defining content attributes and structural layout attributes can be written separately, which makes it easy to find and modify. Try to reduce repeated definitions as much as possible, and do not write repeated attributes that can be inherited. Try to use CSS attribute values that are compatible with IE and Firefox, because some attributes cannot be displayed normally after being written, which is equivalent to wasted effort.
Xhtml file: Try to use external links to call CSS files. CSS attributes that only appear once can also be written inside the file. It is best to write comments when writing code, and be sure to pay attention to the alignment format to facilitate error checking.
That’s all I can think of for now, everyone is welcome to discuss it together.
Attached below are some commonly used resources and links:
CSS2.0 Chinese Manual, Korean Business Website Design Analysis, Color Standard 2004, JS Manual:
http:// www.im286.com/viewthread.php?tid=875287
Xhtml1.0 validation page:
http://validator.w3.org/checklink
CSS Validation page:
http://jigsaw.w3.org/css-validator/
CSS online optimization:
http://flumpcakes.co.uk/ css/optimiser/
Article source: http://www.ifess.com/?p=70 Author: Outdated Ipv6, please indicate when reprinting.