当前位置:网站首页>44 新浪导航 ,小米边栏 练习
44 新浪导航 ,小米边栏 练习
2022-07-25 14:40:00 【hello_sunny123】
一.新浪导航栏



代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>16-padding应用-新浪导航</title>
<style> .nav {
height: 41px; border-top: 3px solid #ff8500; border-bottom: 1px solid #edeef0; background-color: #fcfcfc; /* 本质是让h1盒子里边的文字垂直居中对齐 */ line-height: 41px; } .nav a {
/* a属于行内元素 此时必须要转换成 行内块元素 */ display: inline-block; height: 41px; text-decoration: none; color: #4c4c4c; font-size: 12px; padding: 0 20px; } .nav a:hover {
/* 鼠标放上去变换底色 */ background-color: #eee; /* 鼠标放上去变换文字颜色 */ color: #ff8500; } </style>
</head>
<body>
<div class="nav">
<a href="#">新浪导航</a>
<a href="#">手机新浪网</a>
<a href="#">移动客户端</a>
<a href="#">微博</a>
<a href="#">三个字</a>
</div>
</body>
</html>
结果:

二.小米导航栏修改


代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style> /* 1.把a转化为块级元素 */ a {
display: block; width: 200px; height: 40px; text-decoration: none; background-color: #535758; color: #fff; /* 不精确 text-indent: 2em; */ padding-left: 30px; font-size: 14px; line-height: 40px; } /* 2.鼠标经过更换背景颜色 */ a:hover {
background-color: #fc6e00; } </style>
</head>
<body>
<a href="#">手机 电话卡</a>
<a href="#">电视 盒子 </a>
<a href="#">笔记本 平板 </a>
<a href="#">出行 穿戴 </a>
<a href="#">智能 路由器 </a>
<a href="#">健康 儿童</a>
<a href="#">耳机 音响</a>
</body>
</html>
结果

边栏推荐
- 为什么中建、中铁都需要这本证书?究竟是什么原因?
- Examples of bio, NiO, AIO
- kibana操作es
- Runtimeerror: CUDA out of memory (solved) [easy to understand]
- Vs2017 large factory ERP management system source code factory general ERP source code
- Deng Qinglin, a technical expert of Alibaba cloud: Best Practices for disaster recovery and remote multi activity across availability zones on cloud
- 基于浏览器的分屏阅读
- 006操作符简介
- 06、类神经网络
- 变分(Calculus of variations)的概念及运算规则
猜你喜欢

Heyuan City launched fire safety themed milk tea to boost fire prevention and control in summer

The solution to the problem that the progress bar of ros2 installation connext RMW is stuck at 13%

【MySQL必知必会】触发器 | 权限管理

Melodic + Realsense D435i 配置及错误问题解决

PS制作加载GIF图片教程

English语法_不定代词 - other / another

为什么中建、中铁都需要这本证书?究竟是什么原因?

Gameframework making games (II) making UI interface

The main function of component procurement system, digital procurement helps component enterprises develop rapidly

基于AMD EPYC服务器的EDA芯片设计解决方案
随机推荐
Dpkg package download addresses of various platforms (including arm64)
kibana操作es
51 single chip microcomputer learning notes (1)
OverTheWire-Natas
OverTheWire-Bandit
filters获取data中的数据;filters使用data中的数据
Kibana operation es
Idea error failed to determine a suitable driver class
Awk from getting started to digging in (23) awk built-in variables argc, argc -- command line parameter transfer
pytorch训练代码编写技巧、DataLoader、爱因斯坦标示
直播课堂系统05-后台管理系统
Structure size
Resource not found: rgbd_ Launch solution
C language and SQL Server database technology
Gameframework making games (I)
为什么中建、中铁都需要这本证书?究竟是什么原因?
Wechat official account official environment online deployment, third-party public platform access
Practical guide for network security emergency response technology (Qianxin)
基于PaddleOCR开发uni-app离线身份证识别插件
Initial flask and simple application