固定在右侧的css菜单

本文介绍了一个使用CSS实现的固定在页面右侧的导航菜单。通过绝对定位和特定样式设置,该菜单能够保持在屏幕右侧不变,同时具备良好的视觉效果。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

模仿做来的,万事开头难,谅解啊!

<!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</a>">
<head>
<meta http-equiv="Content-Type" mrc="text/html; charset=gb2312" />
<title>固定在右侧的CSS菜单</title>
<style type="text/css">
<!--
div#navcontainer
{
font-family: arial;
font-weight: bold;
background: #642;
position: absolute;
right: 0px;
margin: 0;
padding: 9px;
border: 0;
}


div#navcontainer ul
{
display: inline;
margin: 0;
padding: 0;
list-style: none;
border: solid 1px #642;
}


div#navcontainer h2
{
border: solid 1px #642;
padding: 4px;
text-align: center;
}


div#navcontainer ul li
{
display: inline;
margin: 0;
}


div#navcontainer ul li a
{
color: #a10;
background: #ffc;
margin: 0;
padding: 2px 5px 2px 5px;
text-decoration: none;
}


div#navcontainer ul li a:hover
{
background: #e8db6f;
border-bottom: solid 9px #ffc;
}
-->
</style>
</head>
<body>
<div id="navcontainer">
<ul id="navlist">
<li id="active"><a href="/" id="current">mb5u.com</a></li>
<li><a href="/sort/list_1_1.shtml">ASP</a></li>
<li><a href="/sort/list_11_203_1.shtml">AJAX</a></li>
<li><a href="/sort/list_11_112_1.shtml">JQUERY</a></li>
<li><a href="/sort/list_11_1.shtml">EXT</a></li>
</ul>
</div>
</body>
</html>

效果图:



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值