Frontend layout principle: Do not use direction naming, do not use pixel locking

Source: Internet
Author: User

A few days ago, I tried Ubuntu 10.04. The resolution was 18.5 inch * 1366 because I used a 768 small display. The screen height is 768 low, so I want to straighten out the taskbar.

As a result, after setting up the taskbar of ubuntu 10.04, there was some misplacement and the date was vertical.

Read ~ The panel configuration file contains two folders, top_panel and bottom_panel. This name does not comply with the "layout principle ".

General frontend layout principles:
    • Do not use the direction name.
    • If pixel pixels are not used for locking, consider the effect of font size enlargement.
Webpage layout principles:
    • Use the scroll bar when the browser resolution is exceeded.
Software layout principles:
    • The maximum height is the screen resolution height, which is difficult to operate if it exceeds the user's

Disadvantages of using direction-based naming: Attributes cannot be changed because they are written in the name. For example:

 
# Sidebar {float: Left;/* correct */}

You can change it:

 
# Sidebar {float: Right;/* correct */}

It is an attribute of the sidebar that is placed on the "Left" or "right. If you do not abide by this principle, this absurd situation will occur:

 
# Left_sidebar/* Error */{float: Right;/* Error */}

Using PX locking is a lazy layout of websites and software. As a result, font size amplification is not supported.

In the past, only the browser could enlarge the font size (set the smallest font size in Firefox), and most websites were misplaced.

 
Body {font-size: 12px;/* Error */}
Body {/* does not declare font-size, correct. The Computer Browser defaults to 16px, and the mobile browser is to be determined */}

In Windows 7, the software can also zoom in the font size. In the control panel -- display, set the zoom in. Then we can see some software misoperations.

References:
    • Web standard practice
    • Proficient in CSS: advanced Web standard solutions-Turing programming Series

Follow the standards, break the rules

 

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: info-contact@alibabacloud.com 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.