How do we usually write HTML and CSS?

Source: Internet
Author: User

the cause of the article, I just to reply to a post,

As a result, one can hardly stop at all. Simply, a poke for fast, anyway is the weekend.

Get, there are so many steps, I understand the situation to do a share, not all are science, but can be part of the reference.

Let me first say, proficiency after getting a state like this:


Get, there are so many steps, I understand the situation to do a share, not all are science, but can be part of the reference.
1. Get first Analysis:
Analyze what, analyze upstream and downstream related situation. First of all, the upstream design and products, if the design of the relevant documents, then carefully read through the document, the relevant business process in the document, page jumps, interaction behavior, design details related to the clearly unclear questions to find the design products to confirm clearly, if necessary to confirm the mail, lest the subsequent wrangling said, then did not say, then said not this, How did that. If it is possible to have a meeting, let the relevant gatekeeper participate, such as Project manager, technical director.
Business process is intuitive is the requirements of the design of the flow chart, such as registration, the success of the phone, and so on, but this is not the final page, but the process, and then the process to the page, which page corresponds to the process of the node, the page jump, jump possible, dependency order, As well as repeating pages of grooming and so on.
Then in the analysis downstream backstage, the data of the page can be implemented smoothly, the background interface data to provide the date, approximate agreement and so on. Whether there is the possibility of the foreground business logic judgment, whether the foreground needs more complex and simple processing. Whether there are missing details in the review, need to reevaluate, or outright veto, and so on.
The purpose of the analysis of these is: these pages to the downstream of the background will be some problems, to prevent the page, some links to unknown, incorrect data, as well as fewer pages, missing modules and so on.
2.2 ways to know before writing a page:
Of course, there are 2 ways to cut, part of the front-end may be the 1th way, is to convert the PSD into an HTML page, to the backend, to complete the data. In fact, there are several problems with this approach:
A. The structure of the page does not have the right to decide, for example, some pages in the backend, you can use the background technology to do a certain split combination. But pure HTML page can not implement this function, if not reasonable split, some resources call, or later page modification has a lot of trouble.
B. The structure status of the page's data, because the design of the page state is an ideal state, but the page has at least three states, such as the minimum data, data, and the state of the data, and the design of the data is just the state, others if the project is less compact design staff, That needs their own brain repair, if there is a real out, it is good to have reference to the basis. Otherwise, later in the test department back to the time is also more troublesome.
C. Task completion discontinuity, because some Ajax interaction occurs, need to re-render the page, so that the structure or style may change, if it is a pure HTML page, that only after the backend to complete the data state, to complete the relevant AJAX related modules, or wait for the backend to complete their own Ajax, Then there are problems in looking for you, and so on, all of which increase the risk or possibility of a bug between co-operation.

In view of the above, I personally recommend using the advantages of the backend language to write a static data structure or directly output the dynamic final View layer page. This makes the page control in the front-end layer fully accountable to the front end, but this requires a condition:
There is a big demand for front-end technical reserves, and it is important to understand a backend language based on the entire interactive process of Ajax or the handling of some common problems.
Of course, it is very iffy, in fact, these things are not difficult. For example, the popular web back-end language PHP, as well as some PHP-related frameworks provided by the view template, it may be said that there is a certain programming basis or the determination to calm down, spend less time basically no problem.
This way also has a disadvantage, is the small activity page, or some of the thematic pages, if completely apply this way, may be too large, not suitable. Pages that use plain HTML will be faster instead.

3. Then is the real hand-written page cut graph:
Writing a page also requires a process, from the initial writing of basic effects to solving common browser-compatible bugs to the final consideration of page reusability, robustness, and extensibility:

A. The robustness of the page:

How to say this, this has been mentioned before, the UI out of the PSD diagram is a page in the ideal state of the form, and the page has data, there will be two extreme states, one, the data is very much, two, very little data. So in the page layout, consider these two states, so that the data too much time, bursting the page, so that the data is too little, the page part of the elements will appear to recover the situation, such a page will appear some details did not deal with the general error.

B. Extensibility of the page:

It can be said that this is also the first extension of the expansion of the meaning, in the page when the module is very small, to consider the future of the addition of sub-modules or the status of the sibling module, for the future to leave a good HTML interface. In the future when adding modules, as little as possible to move the original HTML structure, so that the HTML is easy to expand. This specific situation, specifically dealt with. The general treatment is that if there is likely to be a sibling element on more than one layer, for the background to add sibling elements as far as possible without affecting the existing structure. At first glance, this point looks very small, in fact, if extended to the entire project, a number of projects have a considerable effect.

C. Reuse of pages:

Because the page style similar module many, or the page and the page similar module many, but there will always be a little bit of difference, this is the designer to understand the world and then in the expression of the world's products, we understand the professional ethics of the designer, so only in the early stage to do some technical treatment, lest the late greetings to a post of relatives. The specific module highs have low points, and the structure is exactly the same, but the shading is not necessarily. It is recommended that you put the style of the presentation in a class, and the physical attributes in a class. There is a decorative image is never inserted into the page in the form of a clear label, content-based content is absolutely Way to insert, in order to avoid future multi-theme, multi-language version of the implementation.

Maybe sometimes there is the situation, the page is completely cut out, html,css completely do not know how to write. But the basic knowledge is good, the concept is basically clear. At this time my personal advice should be to absorb others good things when it is also a personal level bottleneck, it is necessary to insist on a complete breakthrough. The specific way is to use Firebug to analyze the first bat each page of each project, there is always a place you can learn from.
4. After you finish cutting the page:
In the professional ethics or a responsible front-end, need to further analyze the structure of each page in the original work overtime, or the time of the family is not considered complete, or the original implementation of the way is not too good, need to further improve, there is performance optimization or structural optimization possible.

Transferred from:

How do we usually write HTML and CSS?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.