There is a question that has troubled web designers for a long time: should we use fixed , fluid, flexible, or hybrid layout ? They each have their own advantages and disadvantages. The final decision depends on the usability of the website, and it may not be easy to achieve the goal with just one layout. So, if it’s so confusing, is there a trick to making the right decision ? By considering several issues and setting target outcomes appropriately, you too can create a successful layout design that combines the best of all worlds. This article discusses the pros and cons of each layout option. In fact, each solution can achieve a successful website layout as long as you keep usability in mind. Why argue about this? Web design is guided by the stick of usability, and due to the diversity of website users, it is already difficult to make a website that is sufficiently usable for different users. When designing a website for a wide range of users, designers must consider the following potential differences among visitors :
Since there is no standard web page size, web designers need to solve countless problems when working. 1. Differences between fixed layout and fluid layoutAlthough most designers and developers have a basic understanding of fixed and fluid web layouts , let’s briefly clarify the concepts. Fixed page layoutFixed web page layout means that the website content is wrapped in a container with a fixed width, and the blocks in the container have fixed percentage or pixel width values. The most important point is that the container cannot be moved. Visitors see content of a fixed width regardless of screen resolution. The diagram above shows how a fixed- width web page layout is generally implemented. The inner components are set to fixed widths of 520, 200, and 200 pixels respectively. 960 pixels width has become a standard for modern web design because most users have screen resolutions of 1024×768 and above. Fluid web layoutA fluid web layout , also known as a liquid web layout , is achieved by setting most components (including the main container) to percentage widths and adapting to the user's screen resolution. The image above shows a fluid web layout . Although most designers will give fixed widths to certain elements within a fluid layout (such as margins and padding), the entire layout generally uses percentage widths and automatically adjusts the actual width based on the user. 2. Fixed layout web designMany designers prefer fixed layouts because they think fixed layouts are safer: what the designer sees is what the user sees . However, when it comes to its pros and cons, it is as worrying as the flow layout. profit
Disadvantages
Fixed layout design exampleThe designers of the following five web pages all make full use of the characteristics of fixed layout web pages. These websites all combine a lot of design elements and use fixed layouts to create a perfect scene . With the help of fixed width, designers can better control additional design elements around the site content, thereby more accurately adjusting the width of content and navigation. Pay special attention to how designers design continuous images for wide screens (try increasing your screen resolution). 3. Avoid the disadvantages of fixed layoutIf you have decided to use a fixed layout , you must know the following tips. They help you mitigate the negative effects of fixed layouts and help you create successful designs. Translation note: The following paragraph seems to be written to pad the word count and earn royalties. Click here to skip this paragraph . Let’s look at the statistics firstMost designers today assume that most Internet users will use a resolution of 1024×768 or higher. A poll published by W3Schools shows that this is not the case (please note that the data from W3Schools cannot be fully trusted, as will be explained in detail later): As you can see, 640×480 doesn’t even qualify on this chart. Data from W3Schools shows that this resolution seems to have been completely abandoned by users. In fact, there are indeed users who use this resolution, but the number of users is too small, so designers completely ignore them and make some more suitable designs with better usability for higher resolutions. Even for users who use this resolution, they may only use it on some small computers that are easy to carry, and it is not the main screen resolution they usually use. However, the statistics here may not be as accurate as everyone expects. Because W3Schools' visitors are mostly from a specific group (designers and web developers), the results may be a bit skewed from the general public. However, other surveys have shown similar results. According to a survey conducted by some independent companies in 2009, the proportion of users of 800×600 resolution is less than 10%. (Annotation: According to the statistics of Benhuoer's website, this number is below 2%) Here’s an interesting chart from SohTanaka.com , where they looked at the compatibility of some large websites with different screen resolutions: All the websites involved in the survey eventually underwent a gorgeous transformation. Even the largest Internet companies have determined that their primary audience is users with larger screen resolutions. For additional research on screen resolution, you can also refer to the following resources:
960px or 760px?To sum up, most designers choose either 960 or 760 as the total pixel width. The former is more suitable for screens with a resolution of 1024×768 or higher, and can leave a little white space. The latter is the optimal display width at 800×600 resolution. Setting it to this width can take care of that 10% and it also looks good on larger screens. Always center the layout as a whole If you want to use a fixed width design, be sure to center the main container to maintain balance (usually using 4. Fluid Page LayoutDesigners have many reasons not to use fluid layouts , but people often fail to see the benefits of fluid layouts. Here are the pros and cons to consider when planning to use a fluid layout: profit
Disadvantages
Examples of fluid layoutsThe following two examples both use percentage widths to adapt to different screen resolutions. The first example adjusts the width of the content block to fit, while the second example adjusts the whitespace size. 5. Design a suitable mobile web layoutAlthough fluid layouts can present certain problems, they can be solved with a little trickery. Simple designThe fewer patterns and complex techniques applied to a fluid web layout , the easier it is to create and maintain. At the same time, it can more easily adapt to different screen resolutions. With more refined code and design, compatibility issues can be better avoided, discovered, and resolved. Take Smashing Magazine for example, they use a fluid layout. The design is very simple, with only the black + orange navigation bar at the top extended, and the width of each content area will change depending on the situation. CSS is used to be compatible with all possible situations and prevent the sidebar and internal content from being misaligned. Minimum width (min-width) and maximum width (max-width)These two CSS properties, min-width and max-width, can be used to specify a fixed width for users with large or small screens. When the screen is too small, the content block is fixed to a specified width, and a horizontal scroll bar appears at the bottom of the screen; when the screen is too large, the content is also fixed to the maximum width to avoid extending too much and affecting the readability of the text. For more details, please refer to:
Unfortunately, most versions of Internet Explorer do not support these two properties. This problem can be solved by using an IE-specific expression: Maximum and Minimum Height and Width in Internet Explorer (also: Chinese reference ). 6. Flexible designThere is actually a third option when designing a web page layout . Some designers prefer to use a so-called "elastic layout" that combines the characteristics of the two main layout types . The key point is to use the unit em to define the element width. The following quote explains what em is and how it works:
Although flexible design seems to bring many benefits, it still has advantages and disadvantages like the previous two layouts . profit
Disadvantages
Flexible layout exampleElastic layout and fluid layout look very similar on the surface, which is why people confuse them most of the time. The fundamental difference is that the length and width units of the elastic layout are em, while the fluid layout uses percentages, and the size of the elastic layout mainly changes according to the font size. This type of design adapts based on the font size in the user's browser. 7. Which layout is more suitable for you?The layout you choose should be determined by the nature of your website . Weigh the above pros and cons and find the right solution for your website needs For example, a portfolio website might be best suited for a fixed width layout . This way you can make something more design-oriented. Not only do you have more control over the individual elements of your design, but the graphical presentation of your work becomes much easier to handle as well. For many designers (including those working on non-portfolio sites), fixed layouts are a good friend that is both easy to work with and gives people a sense of security. Designers who are looking for 100% compatibility would be wise to consider spending some time on fluid layout. The biggest challenge is not the excessive white space that may appear on the wide screen, but the display effect on the small screen. For a website with a large number of users, a small percentage of the user base can be quite significant in absolute terms. Even without considering this, large websites should have a simple and capable design, which can be achieved efficiently using fluid layouts. Still can't make a decision? Don't worry, there are also flexible or partially flexible layout designs available. If used properly, flexible layout can fully integrate the advantages of the two main layouts. Smart designers know how to take advantage of the principles of flexible design, using em units for font and container sizes, and then mixing percentages and pixel widths to set other layout elements. What other designers sayHeidi Cool's reply on Fixed vs. Liquid vs. Elastic Layout This designer's comment is about working with others on a layout , who may not know much about web design:
madr's reply on Where Have All the Flexible Designs Gone? He points out two other advantages of fixed- width layouts :
jphilapy's reply on Where Have All the Flexible Designs Gone? There are two reasons why fluid layouts are worth supporting:
Calrion's reply on About Fluid- and Fixed-Width Layouts Explicitly explains the use of flexible layout :
Georg's reply on About Fluid- and Fixed-Width Layouts Why a mix of the three layouts gives the best results:
|
<<: Example of how to implement underline effects using Css and JS
>>: Overview and Introduction to Linux Operating System
1. Overview I searched a lot online and found tha...
The order in which the browser loads and renders H...
Detailed explanation of Linux vi command The vi e...
1. Nginx service foundation Nginx (engine x) is d...
This article shares the specific code of Vue to r...
Application scenario 1: Domain name-based redirec...
Hello everyone, I am Tony, a teacher who only tal...
Table of contents SQL execution order bin log Wha...
Background of the problem The server monitoring s...
Table of contents Written in front router.json Ro...
If you directly set the width attribute to the sty...
Because I want to write a web page myself, I am al...
Today, database operations are increasingly becom...
Table of contents 1. V8 Source 2. V8 Service Targ...
Table of contents background Target Effect Ideas ...