博客
关于我
强烈建议你试试无所不能的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/

你可能感兴趣的文章
NSString的长度比较方法(一)
查看>>
Azure云服务托管恶意软件
查看>>
My安卓知识6--关于把项目从androidstudio工程转成eclipse工程并导成jar包
查看>>
旧的起点(开园说明)
查看>>
生产订单“生产线别”带入生产入库单
查看>>
crontab导致磁盘空间满问题的解决
查看>>
java基础 第十一章(多态、抽象类、接口、包装类、String)
查看>>
Hadoop 服务器配置的副本数量 管不了客户端
查看>>
欧建新之死
查看>>
自定义滚动条
查看>>
APP开发手记01(app与web的困惑)
查看>>
笛卡尔遗传规划Cartesian Genetic Programming (CGP)简单理解(1)
查看>>
mysql 日期时间运算函数(转)
查看>>
初识前端作业1
查看>>
为啥程序会有bug?
查看>>
跨域技术
查看>>
JS里的居民们7-对象和数组转换
查看>>
计算两个日期的时间间隔,返回的是时间间隔的日期差的绝对值.
查看>>
python初体验
查看>>
配置vue,vue脚手架的应用(老版本)
查看>>