日期:2014-05-16  浏览次数:20756 次

咨询下一下css+div,标题右上角显示 "new"或其他
咨询下一下css+div,标题右上角显示 "new"或其他,一般都用于,标题和导航上
例如http://www.1688.com/ 阿里巴巴首页导航上的  “新”字  或者http://www.smzdm.com/这个网站上面导航上的“new”   最好能给个完整的例子代码,多谢咯。

------解决方案--------------------
其它就是用图片 
 

<style>
.menus{
 position: relative;
}
.menus span{
background:url("http://img.china.alibaba.com/cms/upload/2013/201/298/892102_1573916616.png");
width:20px;
height:20px;
    position: absolute;
top: -20px;
margin-left: -20px;

}
</style>
 
<br/><br/><br/> 
<div class="menus" >
 <a href="#" >待解决</a>&nbsp;
 <a href="#" >已解决</a>&nbsp;
<a href="#"  >推荐[精华] <span  /> </a>
</div>


------解决方案--------------------
<!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>
<style type="text/css">
span{
vertical-align:super;
color:#F00;
}
a{
text-decoration:none;
}
</style>
</head>

<body>
<a href="#">test<span>new</span></a>
<a href="#">test2</a>
</body>
</html>
这样试试