今天一个朋友问我一个问题,效果如图:
实现代码如下:
XML/HTML代码
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>无标题文档</title>
- </head>
- <body>
- <div style=" position:relative; border:1px #CCC solid; height:28px; width:500px; margin:0 auto; padding:1px">
- <div style=" background:#3F9; height:28px; width:200px"></div>
- <strong style=" position:absolute; width:500px; top:7px; text-align:center; overflow:hidden">你的经验是1000,下级是2000</strong>
- </div>
- </body>
- </html>
期待大家有更好的解决方案。