1 <!DOCTYPE HTML>2 <HTML>3 <HeadLang= "en">4 <MetaCharSet= "Utf-8" />5 <title>Horizontal line-text-horizontal line</title>6 <style>7 /*Horizontal line-text-horizontal line-Method 1*/8 ul{padding:0;margin:30px Auto;List-style:None;}9 ul. List1{Border-bottom:1px solid #666;Margin-bottom:-15px;}Ten ul Li a{width:100%;Display:Block;box-sizing:Border-box;padding:5px;Color:Orange;text-align:Center;text-decoration:None;cursor:default;} One ul Li a span{background:#fff;padding:0 10px;} A /*Horizontal line-text-horizontal line-Method 2*/ - . Line{width:300px;Height:0px;Border-bottom:1px solid #666;float: Left;} - #div{float: Left;Height:5px;Line-height:5px;margin:0px 10px;Color:Orange;} the </style> - </Head> - <Body> - <P>Horizontal line-text-horizontal line-Method 1:</P> + <ul> - <Liclass= "List1"></Li> + <Liclass= "List2"><ahref= "javascript:;"><span>Hello World</span></a></Li> A </ul> at <BR/> - <P>Horizontal line-text-horizontal line-Method 2:</P> - <DivID= "Odiv"> - <Divclass= "line"></Div> - <DivID= "Div">Hello World</Div> - <Divclass= "line"></Div> in </Div> - <BR/><BR/><BR/> to <P><Strong>Summarize:</Strong>Method 1 can be adaptive, Method 2 can not, Method 1 better</P> + </Body> - </HTML>
[K]css-Horizontal line-text-Horizontal line (Implementation method)