如题,,,,,,,
在div CSS格式里加个word-break:break-all;就行了
第二种忘了改,第二种是把div的width改成700px!
两种办法:
第一种:
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>absolute样式</title> <style type="text/css"> div{ width:200px; height:200px; border:2px red solid; position:relative; top:20px; right:0; } </style> </head> <body> <div id="div1"><span>1asdf1asdf1asd<br>f1asdf1asdf1as<br>df1as<br>df1asd<br>f1asdf1asdf1a<br>sdf1asdf1asdf1asdf<br>1asdf1asdf1asdf1asdf</span></div> </body> </html>
第二种:
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>absolute样式</title> <style type="text/css"> div{ width:200px; height:200px; border:2px red solid; position:relative; top:20px; right:0; } </style> </head> <body> <div id="div1"><span>1asdf1asdf1asdf1asdf1asdf1asdf1asdf1asdf1asdf1asdf1asdf1asdf1asdf1asdf1asdf1asdf1asdf1asdf</span></div> </body> </html>
马。。。
同问。。。
嵌套进去