*新闻详情页*/>
近期梳理了CSS导航栏栏及弹窗,实际以下:
CSS导航栏
先看来下实际效果:
<!doctype html> <html> <head> <title>Insert your title</title> <meta charset="utf⑻"> <style> body{ font-size:12px; } #discuss{ width:990px; margin:0 auto; } #mt{ /*高宽比:30px,边框,上边框,情况色调*/ height:30px; border:1px solid #ddd; border-top:2px solid #9d9d9d; background:#F7F7F7; } #discuss-content{ border-bottom:1px solid #ddd; padding-bottom:2px; } #discuss-datas{ width:990px; } #discuss-datas thead td{ /*加粗,左右内边距,下边框,文字垂直居中对齐*/ font-weight:bold; padding:5px 0; border-bottom:1px solid #ddd; text-align:center; color:#666; } /*解决 .col1 的款式 (每行第1列的实际效果)*/ #discuss-datas td.col1{ width:620px; text-align:left; } /*內容行中全部的列*/ #discuss-datas tbody td{ /*虚线下推广边框,左右内边距,文字水平垂直居中对齐,文字色调*/ border-bottom:1px dotted #ddd; padding:5px 0; text-align:center; color:#9c9a9c; } /*解决全部超连接*/ #discuss a{ color:#005aa0; text-decoration:none; } #discuss a:hover{ text-decoration:underline; } /*晒,论 两幅图*/ #discuss-datas b{ /*宽度,高宽比,情况特性*/ padding-left:21px; padding-bottom:2px; padding-top:3px; background-image:url(../Images/iconlist_1.png); background-repeat:no-repeat; margin-right:5px; } b.shai{ background-position:⑴10px ⑵20px; } b.lun{ background-position:⑴52px ⑵20px; } /*2017-01-09 波动训练*/ #mt a{ float:left; width:100px; height:30px; text-align:center; line-height:30px; } #mt a.current{ /*上下上边框,情况色调,文字色调*/ border:1px solid #ddd; border-bottom:none; border-top:2px solid #E4393C; background-color:#fff; color:#E4393C; /*部位上调:margin-top 给负值*/ margin-top:⑹px; height:35px; line-height:35px; } #extra p{margin:0;} /*计划方案1*/ /*#extra p.new{ float:left; } #extra p.total{ float:right; } #extra{ overflow:hidden; }*/ /*计划方案2*/ #extra p.total{ float:right; } </style> </head> <body> <!-- 训练 --> <!-- #discuss : width:990px --> <div id="discuss"> <!-- 页签 #mt : height:30px; ,边框,情况 --> <div id="mt"> <a href="#">网友探讨圈</a> <a href="#" class="current">晒单帖</a> <a href="#">探讨帖</a> <a href="#">圈子帖</a> <a href="#">问与答帖</a> </div> <!-- 內容 #discuss-content : 下边框 --> <div id="discuss-content"> <!-- 报表 --> <table id="discuss-datas"> <thead> <tr> <td class="col1">主题</td> <td>回应/访问</td> <td>作者</td> <td>時间</td> </tr> </thead> <tbody> <tr> <td class="col1"> <b class="shai"></b> <a href="#"> 好大1瓶,非常好 </a> </td> <td>0/0</td> <td> <a href="#">2001年冬季</a> </td> <td> 2011⑴1⑴1 11:11:11 </td> </tr> <tr> <td class="col1"> <b class="lun"></b> <a href="#"> 好大1瓶,非常好 </a> </td> <td>0/0</td> <td> <a href="#">2001年冬季</a> </td> <td> 2011⑴1⑴1 11:11:11 </td> </tr> <tr> <td class="col1"> <b class="shai"></b> <a href="#"> 好大1瓶,非常好 </a> </td> <td>0/0</td> <td> <a href="#">2001年冬季</a> </td> <td> 2011⑴1⑴1 11:11:11 </td> </tr> <tr> <td class="col1"> <b class="lun"></b> <a href="#"> 好大1瓶,非常好 </a> </td> <td>0/0</td> <td> <a href="#">2001年冬季</a> </td> <td> 2011⑴1⑴1 11:11:11 </td> </tr> </tbody> </table> <!-- 别的內容(略) --> <div id="extra"> <p class="total"> 共900个话题 <a href="#">访问所有话题</a> </p> <p class="new"> 有难题与别的客户探讨 <a href="#">[发布帖子]</a> </p> </div> </div> </div> </body> </html>
最终实际效果图:
商城导航栏:
<!doctype html> <html> <head> <title>Insert your title</title> <meta charset="utf⑻"> <style> #nav{ /*宽度,高宽比,情况色调,水平垂直居中对齐*/ width:990px; height:40px; background-color:#E64346; margin:0 auto; } #nav p{ /*撤销默认设置margin,宽度,高宽比,情况色调*/ margin:0; width:210px; height:40px; background-color:#CD2A2C; } #nav>p>a{ /*左波动,高宽比,行高,文本:加粗,尺寸,色调,撤销下划线*/ float:left; height:40px; line-height:40px; font-weight:bold; font-size:14px; color:#fff; text-decoration:none; padding-left:15px; } #nav>p>b{ /*右波动,宽度,高宽比,情况,部位*/ float:right; width:20px; height:20px; background:url(../Images/iconlist_2.png) no-repeat ⑹5px 0; margin:10px 10px 0 0; } #nav>p{ float:left; } #nav>ul{ float:left; margin:0; padding:0; list-style:none; } #nav>ul li{ float:left; } #nav>ul li a{ /*宽度,高宽比,行高,文字:水平垂直居中,尺寸,色调,下划线,加粗*/ float:left; width:100px; height:40px; line-height:40px; text-align:center; font-size:14px; color:#fff; text-decoration:none; font-weight:bold; } #nav>ul li a:hover{ background-color:#BD2A2C; } #container{ width:990px; min-height:200px; margin:0 auto; } #cate_box{ margin:0; padding:0; list-style:none; /*宽度,高宽比,情况色调,上下下边框*/ width:210px; min-height:400px; background-color:#FAFAFA; border:2px solid #CD2A2C; border-top:none; box-sizing:border-box; /*上内边距*/ padding-top:5px; } #cate_box>li{ /*左内边距,左右内边距,宽度,下边框(白色)*/ padding:5px 0 5px 10px; width:196px; box-sizing:border-box; border-bottom:1px solid #fff; border-top:1px solid transparent; } #cate_box li:hover{ border-top-color:#ddd; border-bottom-color:#ddd; background-color:#fff; } #cate_box li>a{ color:#333; text-decoration:none; font-size:14px; } </style> </head> <body> <nav id="nav"> <p> <a href="#">所有产品归类</a> <b></b> </p> <ul> <li> <a href="#">主页</a> </li> <li> <a href="#">服饰城</a> </li> <li> <a href="#">食品类</a> </li> <li> <a href="#">团购</a> </li> <li> <a href="#">夺宝岛</a> </li> <li> <a href="#">闪购</a> </li> <li> <a href="#">金融业</a> </li> </ul> </nav> <div id="container"> <ul id="cate_box"> <li> <a href="#">书籍、音像、数据产品</a> </li> <li> <a href="#">电器产品</a> </li> </ul> </div> </body> </html>
导航栏目录弹框实际效果:
原始情况:
电脑鼠标悬停时:
<!doctype html> <html> <head> <title>Insert your title</title> <meta charset="utf⑻"> <style> #my_jd{ width:100px; height:30px; text-align:center; line-height:30px; border:1px solid #000; background-color:#fff; /*相对性精准定位:相互配合 #menu 的肯定精准定位*/ position:relative; cursor:pointer; } #menu{ width:400px; height:100px; background-color:#fff; border:1px solid #000; /*肯定精准定位*/ position:absolute; top:30px; left:⑴px; /*掩藏*/ display:none; } #my_jd:hover #menu{ display:block; } #my_jd:hover #line{ width:100px; position:absolute; border-top:1px solid #fff; } </style> </head> <body> <div id="my_jd"> 我的京东 <!-- 弹出菜单 --> <div id="menu"> 仿真模拟我的京东弹出菜单 </div> <div id="line"></div> </div> </body> </html>
以上便是本文的所有內容,期待对大伙儿的学习培训有一定的协助,也期待大伙儿多多适用脚本制作之家。
Copyright © 2002-2020 ps网页版在线制作_静态网页制作方法_微云网页版_怎么制作一个网页_django网页模板 版权所有 (网站地图) 粤ICP备10235580号