One problem is that when the screen is narrowed down to a certain width, the border bar will be squeezed out
1 Body{2 font-family:' Amarante ', cursive;3 background:URL (http://www.w3cplus.com/sites/default/files/bg_body.png) repeat;5}6 7 . Wrapper{8 margin:0 Auto;9} One . Header-wrapper{ A Background-color:#BD9C8C; -} the . Header{ - width:80%; - Background-color:#BD9C8C; - margin:0 Auto; + Margin-bottom:5px; - text-align:Center; + A} at - - . Main-content-wrapper{ - width:80%; - margin:0 Auto; -} in . Main-content{ - float: Left; to Border-left:255px Solid Pink; + Margin-bottom:15px; - Box-shadow:0 1px 2px 1px rgba (0, 0, 0, 0.2); the} - . Sidebar{ the width:250px; + float: Left; A Margin-bottom:5px; the Background-color:Yellow; + Margin-left:-80%; - Margin-bottom:15px; $} $ Wuyi . Footer-wrapper{ the Clear:both; - Background-color:#BD9C8C; Wu} - . Footer{ About Clear:both; $ width:80%; - margin:0 Auto; - Margin-bottom:5px; - text-align:Center; A +}
<!DOCTYPE HTML><HTMLLang= "en"><Head> <MetaCharest= "Utf-8" /> <!--spaces and slashes are optional - <title>Test</title> <Linkrel= "stylesheet"type= "Text/css"href= "Css/test1.css"></Head> <Body> <Headerclass= "Header-wrapper"> <Divclass= "header"> <H1>Header Content</H1> </Div> </Header> <Mainclass= "Container"> <Divclass= "Main-content-wrapper"> < Sectionclass= "Main-content"> <H2>defines pre-formatted text, and the text that is enclosed in the pre element usually preserves spaces and line breaks. The text is also rendered as equal-width fonts, which can cause a broken paragraph of the label (such as title, and label) to never be included in the defined block, and the allowed text in the pre element can include physical and content-based style changes, as well as links, images, and horizontal dividers<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR></H2> </ Section> </Div> <asideclass= "sidebar"> <H2>Sidebar Content</H2> </aside> </Main> <Footerclass= "Footer-wrapper"> <Divclass= "Footer"> <H2>Footer Content</H2> </Div> </Footer> </Body></HTML>
html-v12.25+ Classroom Exercises-layout left fixed right adaptive