CSS基本布局16例(4)
单行三列5:左右列绝对定位,中间列自适应。宽度满屏。
#left { position: absolute; top: 0px; left: 0px; margin: 0px; padding: 10px; border: 0px; background: #FFF; width: 190px; /* ie5win fudge begins */ voice-family: "\"}\""; voice-family:inherit; width: 170px; } html>body #left { width: 170px; /* ie5win fudge ends */ } #middle { padding: 10px; border: 0px; background: #FFF; /* ie5win fudge begins */ margin: -20px 190px 0px 190px; voice-family: "\"}\""; voice-family:inherit; margin-top: 0px; } html>body #middle { margin-top: 0px; /* ie5win fudge ends */ } #right { position: absolute; top: 0px; right: 0px; /* Opera5.02 will show a space at right when there is no scroll bar */ margin: 0px; padding: 10px; border: 0px; background: #FFF; width: 190px; /* ie5win fudge begins */ voice-family: "\"}\""; voice-family:inherit; width: 170px; } html>body #right { width: 170px; /* ie5win fudge ends */ }
顶行三列
顶行三列1(推荐):顶行自适应页面宽度。左右列绝对定位,中间列自适应页面。
#top { margin: 20px 20px 0px 20px; padding: 10px; border: 5px solid #666; background: #FFF; height: 100px; /* ie5win fudge begins */ voice-family: "\"}\""; voice-family:inherit; height: 70px; } html>body #top { height: 70px; /* ie5win fudge ends */ } #left { position: absolute; top: 120px; left: 0px; margin: 20px; padding: 10px; border: 5px solid #666; background: #FFF; width: 150px; /* ie5win fudge begins */ voice-family: "\"}\""; voice-family:inherit; width: 120px; } html>body #left { width: 120px; /* ie5win fudge ends */ } #middle { margin: 20px 190px 20px 190px; padding: 10px; border: 5px solid #666; background: #FFF; } #right { position: absolute; top: 120px; right: 0px; /* Opera5.02 will show a space at right when there is no scroll bar */ margin: 20px; padding: 10px; border: 5px solid #666; background: #FFF; width: 150px; /* ie5win fudge begins */ voice-family: "\"}\""; voice-family:inherit; width: 120px; } html>body #right { width: 120px; /* ie5win fudge ends */ }