1、网页侧边栏导航
给你个思路,做个div固定那个位置,然后添加图片超链接!
2、在网页上增加一个侧边栏
sdf
3、HTML5设计一个导航侧边栏?
使用公式(an+ b).描述抄:a代表一个循环的大小,N是一个计数器(从0开始),以及b是偏移量。
p:nth-of-type(2n+0)
{
background:red;
}
p:nth-of-type(2n+1)
{
background:blue;
}
4、网页导航栏的设计方式有哪些
导航栏的设计方式有很多种,通过专业的PS设计软件,可以结合自己的灵感设计,网上有很多可以做为参考或欣赏。
5、HTML使用DIV+CSS如何实现左边导航,右边显示内容,点击那个导航显示那个内容
1、新建html文档。
2、书写hmtl代码。
<ul>
<li><A class="hover" 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>
<div id="lanPos"></div>
</ul>
3、书写css代码。
<style>
html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary, time, mark, audio, video { margin: 0; padding: 0; border: 0; outline: 0; font-size: 100%; vertical-align: baseline; background: transparent; font-weight: normal; }
body { line-height: 1; }
:focus { outline: 1; }
article, aside, canvas, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary { display: block; }
nav ul, ul, li { list-style: none; }
blockquote, q { quotes: none; }
blockquote:before, blockquote:after, q:before, q:after { content: ''; content: none; }
a { margin: 0; padding: 0; border: 0; font-size: 100%; vertical-align: baseline; background: transparent; text-decoration: none; }
a:hover { text-decoration: underline; }
ins { background-color: #ff9; color: #000; text-decoration: none; }
mark { background-color: #ff9; color: #000; font-style: italic; font-weight: bold; }
del { text-decoration: line-through; }
abbr[title], dfn[title] { border-bottom: 1px dotted #000; cursor: help; }
table { border-collapse: collapse; border-spacing: 0; }
hr { display: block; height: 1px; border: 0; border-top: 1px solid #cccccc; margin: 1em 0; padding: 0; }
input, select { vertical-align: middle; }
.fl { float: left; display: inline-block; }
.fr { float: right; display: inline-block; }
.clearfix:after { visibility: hidden; display: block; font-size: 0; content: " "; clear: both; height: 0; }
.clearfix { display: inline-table; }
* html .clearfix { height: 1%; }
.clearfix { display: block; }
html { font-size: 62.5%; /* 10÷16=62.5% */ }
body { font-size: 12px; font-size: 1.2rem; background: #F8F8F8; font-family: "宋体"; }
ul { width: 180px; margin: 0 auto; background: #fff; position: relative; z-index: 0; padding: 60px 20px 70px; }
ul li { height: 40px; line-height: 40px; text-align: center; border-bottom: 1px solid #F8F8F8; }
ul li a { color: #666; display: block; }
ul li a:hover { color: #FF5F3E; text-decoration: none; }
ul li a.hover { color: #FF5F3E; }
#lanPos { width: 225px; height: 40px; line-height: 40px; background: #F8F8F8; border-left: 5px solid #FF5F3E; position: absolute; left: -5px; top: 0; z-index: -1; transition: top .2s; }
</style>
4、书写并引用js代码。
<script src="js/jquery.min.js"></script>
<script>
$(function(){
$('#lanPos').css('top',$('.hover').offset().top);
$('ul li').hover(function(){
$('#lanPos').css('top',$(this).offset().top);
},function(){
$('#lanPos').css('top',$('.hover').offset().top);
})
$('ul li').click(function(){
for(var i=0;i<$('ul li').size();i++){
if(this==$('ul li').get(i)){
$('ul li').eq(i).children('a').addClass('hover');
}else{
$('ul li').eq(i).children('a').removeClass('hover');
}
}
})
})
</script>
5、代码整体结构。
6、查看效果
6、html文件,实现上方导航和左侧边栏不变,而右侧边栏信息变换?是用框架吗
用框架可以做:
1.建立主页面,就是你打开就能看到的页面
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>网页标题</title>
</head>
<frameset rows="16%,84%"border="0">
<frame noresize src="top.htm" scrolling="no">
<frameset cols="25%,*" >
<frame scrolling="no" noresize src="left.htm">
<frame name="rgt" src="right.htm">
</frameset>
</frameset>
<noframes></noframes>
</html>这里面top.htm就是上方导航,left.htm就是左侧信息,right.htm就是右侧信息
2.建立顶部页面top.htm
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<table width=50% align=center>
<tr align=center>
<td width=50%><a target="rgt" href="right.htm">导航1</a></td>
<td width=50%><a target="rgt" href="right2.htm">导航2</a></td>
</tr>
</table>
</body>
</html>
这里要注意target="rgt",rgt是我们在第一步里right.htm的name,也就是说点击这里,右边的内容会跳转到指定的页面,也就实现了右边信息的变换
这里我只写两个,你自己在导航里改,凡是有链接的你都加上target="rgt"
3.建立左部页面left.htm
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<a href="right.htm" target="rgt">右部信息1</a>
<br><br>
<a href="right2.htm" target="rgt">右部信息2</a>
</body>
</html>
这里同样,凡是有链接的你都加上target="rgt",点击后右边内容会随之变换
4.建立右部信息页面right.htm
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<table>
<tr>
<td valign="top" width="500" height="1000">
<h3 align="center">右边信息</h3>
</td>
</tr>
</table>
</body>
</html>
这里是打开主页面后看到的右边部分的内容
5.建立右边部分等待切换的页面right2.htm
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<table>
<tr>
<td valign="top" width="500" height="1000">
<h3 align="center">右边信息二</h3>
</td>
</tr>
</table>
</body>
</html>
注意这个right2.htm在top.htm和left.htm里都出现过
也就是说点击它们就会将右边内容切换到相应页面
我这里只做了两个,如果多的话就继续做right3.htm之类
OK完成
7、网页侧边栏这个效果是怎么实现的?
悬浮按钮
相对于窗口来定位,因为位置一直固定在窗口的一个位置,所以看着像悬浮
position设置为fixed,再用top,left,right,bottom等属性定位
8、网页设计如何打出这个框架?尤其是“侧边栏+主体框”?劳烦大神帮打一下!谢谢!
首先等一个网页的宽度,然后再写css样式。直接给你实例代码吧:
<style>