Five ways to resolve column height adaptation (same) _ Experience Exchange

Source: Internet
Author: User
1. Background map fill

This is one of the most widely used practices, no hacks, recommended use:





<title>Equal Height (column height same method)</title>






Head





Sideleft


Default length Extended page


It is not easy to move from a fixed, pixel-based design approach to a resilient, relative design approach. But if used properly, it can be a natural selection to enhance affinity and ease of use without sacrificing design.


Pixels are non-scalable points on the computer screen, and a
H3 is a word-sized block. Due to the change in font size, H3
Represents the relative units of text size that the user prefers.


It may be easier to adopt a printed fixed design, because if the dimensions are not changed, then there are relatively few things to consider. But if you adopt a flexible design approach, you can make the most of your computer's display and browser.


Maybe you want your site to appear in a certain way, but what your users want to see may not be the same. Anything that is imposed on the user is not conducive to ease of use, thereby damaging the site's success.


It is not easy to move from a fixed, pixel-based design approach to a resilient, relative design approach. But if used properly, it can be a natural selection to enhance affinity and ease of use without sacrificing design.



Sideright


It is not easy to move from a fixed, pixel-based design approach to a resilient, relative design approach. But if used properly, it can be a natural selection to enhance affinity and ease of use without sacrificing design.


Pixels are non-scalable points on the computer screen, and a
H3 is a word-sized block. Due to the change in font size, H3
Represents the relative units of text size that the user prefers.


It may be easier to adopt a printed fixed design, because if the dimensions are not changed, then there are relatively few things to consider. But if you adopt a flexible design approach, you can make the most of your computer's display and browser.


Maybe you want your site to appear in a certain way, but what your users want to see may not be the same. Anything that is imposed on the user is not conducive to ease of use, thereby damaging the site's success.





Footer

Production: Web Pottery Bar










2. Using script to control the height of the column (i)

The height of the column needs to be known in advance, which is used as a baseline for scripting control.

document.getElementById ("Sideleft"). Style.height=document.getelementbyid ("Sideright"). scrollHeight+ "px"

The above code controls the height of the sideleft at the base height of the sideright.

The code is simple, but relatively passive:





<title>Equal height (using JS to implement the same column height method)</title>





Head




Sideleft


It is not easy to move from a fixed, pixel-based design approach to a resilient, relative design approach. But if used properly, it can be a natural selection to enhance affinity and ease of use without sacrificing design.


Pixels are non-scalable points on the computer screen, and a
H3 is a word-sized block. Due to the change in font size, H3
Represents the relative units of text size that the user prefers.


It may be easier to adopt a printed fixed design, because if the dimensions are not changed, then there are relatively few things to consider. But if you adopt a flexible design approach, you can make the most of your computer's display and browser.


Maybe you want your site to appear in a certain way, but what your users want to see may not be the same. Anything that is imposed on the user is not conducive to ease of use, thereby damaging the site's success.


It is not easy to move from a fixed, pixel-based design approach to a resilient, relative design approach. But if used properly, it can be a natural selection to enhance affinity and ease of use without sacrificing design.


Pixels are non-scalable points on the computer screen, and a
H3 is a word-sized block. Due to the change in font size, H3
Represents the relative units of text size that the user prefers.


It may be easier to adopt a printed fixed design, because if the dimensions are not changed, then there are relatively few things to consider. But if you adopt a flexible design approach, you can make the most of your computer's display and browser.


Maybe you want your site to appear in a certain way, but what your users want to see may not be the same. Anything that is imposed on the user is not conducive to ease of use, thereby damaging the site's success.




Sideright


It is not easy to move from a fixed, pixel-based design approach to a resilient, relative design approach. But if used properly, it can be a natural selection to enhance affinity and ease of use without sacrificing design.


Pixels are non-scalable points on the computer screen, and a
H3 is a word-sized block. Due to the change in font size, H3
Represents the relative units of text size that the user prefers.


It may be easier to adopt a printed fixed design, because if the dimensions are not changed, then there are relatively few things to consider. But if you adopt a flexible design approach, you can make the most of your computer's display and browser.


Maybe you want your site to appear in a certain way, but what your users want to see may not be the same. Anything that is imposed on the user is not conducive to ease of use, thereby damaging the site's success.






Footer

Production: Web Pottery Bar










3. Use script to control the height of the column (ii)

No need to know in advance which column height, script automatically judge.

The code is more complex and a bit delayed:





<title>Script control three rows of three-column adaptive height div layout</title>




Script control three rows of three-column adaptive height div layout




Affinity refers not just to blind people and screen readers. There are many people who are not blind, but have visual impairments--you and I will become one of them when I get older.
One of the simplest ways to make a site more approachable is to allow users to change the size of the text, and denying the user the right to take the lead is likely to make the user unable to read comfortably.


Affinity refers not just to blind people and screen readers. There are many people who are not blind, but have visual impairments--you and I will become one of them when I get older.
One of the simplest ways to make a site more approachable is to allow users to change the size of the text, and denying the user the right to take the lead is likely to make the user unable to read comfortably.



Affinity refers not just to blind people and screen readers. There are many people who are not blind, but have visual impairments--you and I will become one of them when I get older.
One of the simplest ways to make a site more approachable is to allow users to change the size of the text, and denying the user the right to take the lead is likely to make the user unable to read comfortably.



If the designer uses pixels to specify the text size, most users will not be able to scale the text because Internet Explorer changes the text size differently than other browsers. Mozilla and Opera can scale text that has been set to a pixel size, while IE in Windows does not.



Affinity refers not just to blind people and screen readers. There are many people who are not blind, but have visual impairments--you and I will become one of them when I get older.
One of the simplest ways to make a site more approachable is to allow users to change the size of the text, and denying the user the right to take the lead is likely to make the user unable to read comfortably.



If the designer uses pixels to specify the text size, most users will not be able to scale the text because Internet Explorer changes the text size differently than other browsers. Mozilla and Opera can scale text that has been set to a pixel size, while IE in Windows does not.



Affinity refers not just to blind people and screen readers. There are many people who are not blind, but have visual impairments--you and I will become one of them when I get older.
One of the simplest ways to make a site more approachable is to allow users to change the size of the text, and denying the user the right to take the lead is likely to make the user unable to read comfortably.



For demo pages only pottery bar








4. Combined with negative outer boundary and inner patch

There is no need to know in advance which column's height.

Hacks more (mainly opera), but easy to use, recommended:





<title>Equal Height (workaround for adaptive height in div+css layout)</title>





Head




Sideleft


It is not easy to move from a fixed, pixel-based design approach to a resilient, relative design approach. But if used properly, it can be a natural selection to enhance affinity and ease of use without sacrificing design.


Pixels are non-scalable points on the computer screen, and a
H3 is a word-sized block. Due to the change in font size, H3
Represents the relative units of text size that the user prefers.


It may be easier to adopt a printed fixed design, because if the dimensions are not changed, then there are relatively few things to consider. But if you adopt a flexible design approach, you can make the most of your computer's display and browser.


Maybe you want your site to appear in a certain way, but what your users want to see may not be the same. Anything that is imposed on the user is not conducive to ease of use, thereby damaging the site's success.


It is not easy to move from a fixed, pixel-based design approach to a resilient, relative design approach. But if used properly, it can be a natural selection to enhance affinity and ease of use without sacrificing design.


Pixels are non-scalable points on the computer screen, and a
H3 is a word-sized block. Due to the change in font size, H3
Represents the relative units of text size that the user prefers.


It may be easier to adopt a printed fixed design, because if the dimensions are not changed, then there are relatively few things to consider. But if you adopt a flexible design approach, you can make the most of your computer's display and browser.


Maybe you want your site to appear in a certain way, but what your users want to see may not be the same. Anything that is imposed on the user is not conducive to ease of use, thereby damaging the site's success.




Sideright


It is not easy to move from a fixed, pixel-based design approach to a resilient, relative design approach. But if used properly, it can be a natural selection to enhance affinity and ease of use without sacrificing design.


Pixels are non-scalable points on the computer screen, and a
H3 is a word-sized block. Due to the change in font size, H3
Represents the relative units of text size that the user prefers.


It may be easier to adopt a printed fixed design, because if the dimensions are not changed, then there are relatively few things to consider. But if you adopt a flexible design approach, you can make the most of your computer's display and browser.


Maybe you want your site to appear in a certain way, but what your users want to see may not be the same. Anything that is imposed on the user is not conducive to ease of use, thereby damaging the site's success.





Footer

Production: Web Pottery Bar











5. Adopt negative left and right boundary and relative positioning

The following example is a good way to solve the problem of the same column height.

Three row two column layout, main content on the left, Web page width 750px, left column 580px, right column 170px.

CSS code:

#middle {
width:580px;
Float:left;
Background: #FFFFFF;
Text-align:left;
}
#sideleft {
width:580px;
Float:left;
position:relative;
margin-left:-580px;
}
#sideright {
width:170px;
Float:right;
position:relative;
margin:0 -170px 0 0;
Background: #F0F0F0;
}

XHTML code:








From the structure, middle (using the left column want the background color) at the outermost, width equal to the width of sideleft, a layer is sideright, its width is 170px, the floating direction is the right. But its right side of the border is negative 170px, the equivalent of pulling sideright to the left (to the left of the middle to the left) 170px position. And Sideleft is set in Sideright inside, its content precedes sideright out, the left margin is negative 580, equivalent to the left side of Sideright 580px, at this time sideleft and middle position coincident.

Pros: No background image, no hacks, full adaptive height.

Cons: Now the code can only be left-aligned.

Demonstrate:





<title>Equal Height (workaround for adaptive height in div+css layout)</title>





Head




Sideleft


It is not easy to move from a fixed, pixel-based design approach to a resilient, relative design approach. But if used properly, it can be a natural selection to enhance affinity and ease of use without sacrificing design.


Pixels are non-scalable points on the computer screen, and a
H3 is a word-sized block. Due to the change in font size, H3
Represents the relative units of text size that the user prefers.


It may be easier to adopt a printed fixed design, because if the dimensions are not changed, then there are relatively few things to consider. But if you adopt a flexible design approach, you can make the most of your computer's display and browser.


Maybe you want your site to appear in a certain way, but what your users want to see may not be the same. Anything that is imposed on the user is not conducive to ease of use, thereby damaging the site's success.


It is not easy to move from a fixed, pixel-based design approach to a resilient, relative design approach. But if used properly, it can be a natural selection to enhance affinity and ease of use without sacrificing design.


Pixels are non-scalable points on the computer screen, and a
H3 is a word-sized block. Due to the change in font size, H3
Represents the relative units of text size that the user prefers.


It may be easier to adopt a printed fixed design, because if the dimensions are not changed, then there are relatively few things to consider. But if you adopt a flexible design approach, you can make the most of your computer's display and browser.


Maybe you want your site to appear in a certain way, but what your users want to see may not be the same. Anything that is imposed on the user is not conducive to ease of use, thereby damaging the site's success.





Sideright


It is not easy to move from a fixed, pixel-based design approach to a resilient, relative design approach. But if used properly, it can be a natural selection to enhance affinity and ease of use without sacrificing design.


Pixels are non-scalable points on the computer screen, and a
H3 is a word-sized block. Due to the change in font size, H3
Represents the relative units of text size that the user prefers.


It may be easier to adopt a printed fixed design, because if the dimensions are not changed, then there are relatively few things to consider. But if you adopt a flexible design approach, you can make the most of your computer's display and browser.


Maybe you want your site to appear in a certain way, but what your users want to see may not be the same. Anything that is imposed on the user is not conducive to ease of use, thereby damaging the site's success.





Footer

Production: Web Pottery Bar









  • 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.