当前位置: 首页 > 图文教程 > 网页制作 > CSS样式表 > 网页制作实例:em实现倒三角的提示效果

CSS样式表
CSS:提高网页在浏览器的渲染速度
css网页制作实用技巧9则
思考Web站点设计对类以及id的命名方式
CSS教程:关于网页图片的属性
CSS教程:元素层叠级别及z-index
div css在思路和流程上实现结构与表现的分离
CSS入门教程:网页首字下沉
IE6、IE7和FF的最简单的hack技巧
跨浏览器实现float:center
css技巧:经典CSS使用技巧几则
CSS教程:legend标签设定宽度
网站进行W3C XHTML1.0验证的经验
CSS教程:网页颜色的几种表示
网页CSS背景图片使用的测试结果
CSS网页布局:网页页面结构化
SPAN和DIV,Class与ID的区别汇总
xhtml css网页制作中问题解决的方式
div css与xhtml css是什么意思?
CSS样式表优化更整洁而简短
CSS设计网站导航菜单的优势

CSS样式表 中的 网页制作实例:em实现倒三角的提示效果


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-28   浏览: 73 ::
收藏到网摘: n/a

效果如下:

uploads/200811/12_155025_223323t.jpg


鼠标放上显示第二个的效果!
代码如下:

<!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=gb2312" />
<title>em实现倒三角的提示效果-JS特效学院</title>
</head>
<style>
 <!--
 #menu {width:500px;padding:0;margin:40px auto;list-style-type:none;display:<span href="tag.php?name=tab" onclick="tagshow(event)" class="t_tag">tab</span>le;}
 #menu li {width:100px; float:left; line-height:30px}
 #menu a {position:relative;display:block; text-decoration:none; background:#cccccc;width:100px; }
 #menu a span {display:block; font-weight:bold;color:#000; border-style:solid;border-width:0px 2px 2px 0px; border-color:#fff #fff #06a #fff;text-align:center; }#menu a em {display:none;}
 #menu a:hover {background:#FF0000;}#menu a:hover span {color:#fff; }
 #menu a:hover em {display:block; overflow:hidden; border:6px solid #06a; border-color:#06a #fff; border-width:6px 6px 0 6px; position:absolute; left:50%; top:100%;margin-left:-6px;}
 -->
 </style>
<body>
 <ul id="menu">
 <li><a href="http://www.ruanchen.com/"codeTextarea"><!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=gb2312" /> <title>em实现倒三角的提示效果-JS特效学院</title> </head> <style> <!-- #menu {width:500px;padding:0;margin:40px auto;list-style-type:none;display:<span href="tag.php?name=tab" onclick="tagshow(event)" class="t_tag">tab</span>le;} #menu li {width:100px; float:left; line-height:30px} #menu a {position:relative;display:block; text-decoration:none; background:#cccccc;width:100px; } #menu a span {display:block; font-weight:bold;color:#000; border-style:solid;border-width:0px 2px 2px 0px; border-color:#fff #fff #06a #fff;text-align:center; }#menu a em {display:none;} #menu a:hover {background:#FF0000;}#menu a:hover span {color:#fff; } #menu a:hover em {display:block; overflow:hidden; border:6px solid #06a; border-color:#06a #fff; border-width:6px 6px 0 6px; position:absolute; left:50%; top:100%;margin-left:-6px;} --> </style> <body> <ul id="menu"> <li><a href="http://www.ruanchen.com/"runCode(this.offsetParent.getElementsByTagName('textarea')[0])" type="button" value="运行代码" /> [Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]