博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
如何构建顶部导航条_如何构建导航栏
阅读量:2533 次
发布时间:2019-05-11

本文共 1680 字,大约阅读时间需要 5 分钟。

如何构建顶部导航条

Navigation bars are a very important element to any website. They provide the main method of navigation by providing a main list of links to a user. There are many methods to creating a navigation bar. The easiest way to create a navigation bar is to use an unordered list and style it with CSS.

导航栏对于任何网站都是非常重要的元素。 它们通过提供指向用户的链接的主要列表,提供了主要的导航方法。 创建导航栏的方法有很多。 创建导航栏的最简单方法是使用无序列表,并使用CSS设置其样式。

Navigation Bars are mostly made up of <ul> lists that are horizontally arranged and styled.

导航栏主要由水平排列和样式化的<ul>列表组成。

While styling the navigation bars, it’s common to remove the extra spacing created by the <ul> and <li> tags as well as the bullet points that are automatically inserted:

设置导航栏的样式时,通常会删除<ul><li>标记以及自动插入的项目符号点所创建的多余间距:

list-style-type: none;   margin: 0px;   padding: 0px;

Example:

例:

There are two parts to any navigation: the HTML and the CSS. This is just a quick example.

任何导航都有两部分:HTML和CSS。 这只是一个简单的例子。

/* Define the main Navigation block */.myNav {    display: block;    height: 50px;    line-height: 50px;    background-color: #333;}/* Remove bullets, margin and padding */.myNav ul {    list-style: none;    padding: 0;    margin: 0;}.myNav li {    float: left;    /* Or you can use display: inline; */}/* Define the block styling for the links */.myNav li a {    display: inline-block;    text-align: center;    padding: 14px 16px;}/* This is optional, however if you want to display the active link differently apply a background to it */.myNav li a.active {    background-color: #3786E1;}

翻译自:

如何构建顶部导航条

转载地址:http://gbuzd.baihongyu.com/

你可能感兴趣的文章
Hibernate三大类查询总结
查看>>
软件测试第5次作业
查看>>
TypeScript完全解读(26课时)_9.TypeScript完全解读-TS中的类
查看>>
内置函数 集锦
查看>>
文成小盆友python-num6 -反射 ,常用模块
查看>>
Struts2.0中ActionInvocation使用
查看>>
使用samba实现linux与windows共享(测试成功)
查看>>
k8s 常用命令
查看>>
UnderWater+SDN论文之二
查看>>
jQuery.ajax() 设置 Headers 中的 Accept 内容
查看>>
[leetcode] Validate Binary Search Tree
查看>>
省选前的字符串抢救计划
查看>>
Math工具类的使用
查看>>
C++ 中头文件(.h)和源文件(.cc)的写法简述
查看>>
iOS 崩溃 问题 警告 错误2
查看>>
监听系统键盘的方法
查看>>
《DSP using MATLAB》Problem 7.25
查看>>
[连载]《C#通讯(串口和网络)框架的设计与实现》-1.通讯框架介绍
查看>>
成绩转换
查看>>
C# BackgroundWorker的使用 转
查看>>