Home Web Front-end CSS Tutorial Implement navigation bar using html and CSS3

Implement navigation bar using html and CSS3

Jun 20, 2018 pm 04:44 PM
css3 html5

This article will share with you how to create a cool navigation bar based on html and CSS3. The effect is very beautiful. Friends who need it can refer to it

Main highlights:

1 ul horizontal display

2 li remove dots

3 li center the font horizontally and vertically

4 li control border style

5 Use html css3 gradient painting to make background images

6 Change color transparency

7 p Make border shadow

Look at the renderings first:

##

<!doctype html>     
html lang="en">     
<head>     
 <meta charset="UTF-8"> <!----编码----->     
 <meta name="Generator" content="EditPlus®">     
 <meta name="Author" content="黄涛">     
 <meta name="Keywords" content="关键字,搜索引擎">     
 <meta name="Description" content="描述语言">     
 <title>案例</title>     
   <style type="text/css">     
       *{ margin:0;padding:0; }     
       body{background:url("images/bg_title.jpg") repeat-x,url("images/bg.jpg");}     
       #Logo{     
           width:895px;height:45px;     
           /*margin:上下 左右*/     
           margin:50px auto;     
           border-radius:10px;     
           /*html + css3 渐变画图 */     
               background-image:-webkit-linear-gradient(rgba(41,41,41,0.75) 0% ,rgba(54,54,54,0.72) 50%,rgba(24,23,23,0.94) 51%);     
           box-shadow:1px 1px 33px #fff;/*设计阴影的*/     
       }     
       #Logo ul li     
       {     
           width:127px; height:45px;     
           list-style:none;/*去掉圆点*/     
           float:left;/*水平显示*/     
           color:white;/* #fff */     
           font-size:18px;     
           font-family:"微软雅黑";     
           text-align:center;     
           line-height:45px;/* 行高跟 高度一致时,竖直居中*/     
           border-right:1px solid #000;/*右边框*/     
       }     
       #Logo ul li a     
       {     
           color:white;/* #fff */     
           font-size:18px;     
           font-family:"微软雅黑";     
           text-decoration:none;     
       }     
       #Logo ul li:hover     
       {     
           background:rgba(10,5,5,0.45);     
       }     
       #Logo ul li.first:hover     
       {     
           border-radius:10px 0px 0px 10px;/*左上 左下 圆弧显示 */     
       }     
       #Logo ul li.last:hover     
       {     
           border-radius:0px 10px 10px 0px;/*右上 右下 圆弧显示 */     
       }     
       #Logo ul li ul li      
       {     
           border:none;     
           border-top:1px solid #989898;     
           background:rgba(10,5,5,0.45);/*颜色透明度 */     
           border-radius:10px;     
       }     
       #Logo ul li ul     
       {     
           display:none;/*不显示*/     
       }     
       #Logo ul li ul li:hover     
       {     
           background:rgba(10,5,5,0.8);/*颜色透明度 */     
           border-radius:10px;     
       }     
       #Logo ul li:hover ul     
       {     
           display:block;     
           -webkit-animation:roll 1s ease;/*roll 旋转名称,1s旋转效果 */     
       }     
       @-webkit-keyframes roll /*roll旋转名称与上面一致*/     
       {     
           0% {-webkit-transform:rotate(0deg);}     
           100% {-webkit-transform:rotate(360deg);}     
       }     
   </style>     
</head>     
<body>     
   <p id="Logo">     
       <ul>     
           <li class="first">      
               <a href="#">网址<a>     
               <ul>     
                   <li>     
                       <a href="http://www.baidu.com">百度</a>     
                   </li>     
                   <li>     
                       <a href="http://www.sina.com">新浪</a>     
                   </li>     
               </ul>     
           </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 class="last" style="border:none;">      
               <a href="#">关于<a>     
           </li>     
       </ul>     
   </p>     
</body>     
/html>
Copy after login

The code is super simple, I hope it will be helpful for everyone to learn to make html and css3 to make a cool navigation bar .


The above is the entire content of this article. I hope it will be helpful to everyone's study. For more related content, please pay attention to the PHP Chinese website!

Related recommendations:

How to use CSS3 to implement waterfall flow layout

How to use CSS3 with IE filters to achieve gradients and The effect of projection

About the simple implementation of css transition and 3D effect

##

The above is the detailed content of Implement navigation bar using html and CSS3. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Table Border in HTML Table Border in HTML Sep 04, 2024 pm 04:49 PM

Guide to Table Border in HTML. Here we discuss multiple ways for defining table-border with examples of the Table Border in HTML.

Nested Table in HTML Nested Table in HTML Sep 04, 2024 pm 04:49 PM

This is a guide to Nested Table in HTML. Here we discuss how to create a table within the table along with the respective examples.

HTML margin-left HTML margin-left Sep 04, 2024 pm 04:48 PM

Guide to HTML margin-left. Here we discuss a brief overview on HTML margin-left and its Examples along with its Code Implementation.

HTML Table Layout HTML Table Layout Sep 04, 2024 pm 04:54 PM

Guide to HTML Table Layout. Here we discuss the Values of HTML Table Layout along with the examples and outputs n detail.

HTML Input Placeholder HTML Input Placeholder Sep 04, 2024 pm 04:54 PM

Guide to HTML Input Placeholder. Here we discuss the Examples of HTML Input Placeholder along with the codes and outputs.

HTML Ordered List HTML Ordered List Sep 04, 2024 pm 04:43 PM

Guide to the HTML Ordered List. Here we also discuss introduction of HTML Ordered list and types along with their example respectively

HTML onclick Button HTML onclick Button Sep 04, 2024 pm 04:49 PM

Guide to HTML onclick Button. Here we discuss their introduction, working, examples and onclick Event in various events respectively.

Moving Text in HTML Moving Text in HTML Sep 04, 2024 pm 04:45 PM

Guide to Moving Text in HTML. Here we discuss an introduction, how marquee tag work with syntax and examples to implement.

See all articles