当前位置: 首页 > news >正文

web前端--网页练习

html代码:

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>小米</title><!-- 引入重置样式 --><link rel="stylesheet" href="../reset.css"><!-- 引入样式 --><link rel="stylesheet" href="./index.css"></head>
<body><!-- 顶部导航条 --><!--版心 --><div class="container" clearfix><!-- 左侧的小米logo --><div class="logo leftfix"><img src="./image/mi.png" alt="logo"></div><!-- 中间的导航条 --><div class="topbar-nav"><ul class="list clearfix"><li><a href="#">小米官网</a></li><li><a href="#">小米商城</a></li><li><a href="#">小米澎湃OS</a></li><li><a href="#">小米汽车</a></li><li><a href="#">小米影像</a></li><li><a href="#">云服务</a></li><li><a href="#">IoT</a></li><li><a href="#">有品</a></li><li><a href="#">小爱开放平台</a></li><li><a href="#">Location</a></li></ul></div><!-- 右侧的登录区 --><div class="topbar-login  "><a href="#" class="login">登录</a> <span class="ge">|</span><a href="#" class="reset">注册</a></div></body>
</html>

css代码:

/* 基础设置 */
.container{width: 1440px;height: 65px;margin: 0 auto;background-color:black;display: flex;position:relative
}
/* 顶部导航条stare */.container.logo{width: 32px;height: 32px;position: absolute; 
}
.container .logo img {width: 32px;height: 32px;margin-left: 12px;margin-top:14px;
}
.topbar-nav{width: 938px;height: 65px;margin: 0 auto;}
.topbar-nav .list{width: 938px;height: 65px;line-height: 65px;
}
.topbar-nav .list li a {float: left;font-family: MiSans, serif;font-weight: 600;line-height: 65px;font-size: 15px;color: #fff;margin: 0 20px; }
.topbar-nav .list li a:hover {color:#ff6900;
}
.topbar-nav .list li:first-child a {margin-left: 0px;color: #ff6900;
}
.topbar-nav .list li:last-child a {margin-right: 0px;
}.topbar-login a:hover{color:#ff6900;
}
.topbar-login {height: 65 px;width: 100px;margin-right: 10px;}
.topbar-login>a {color: #fff;position: relative;height: 65px;font-size: 16px;line-height: 65px;align-items: center;cursor: pointer;font-family: MiSans, serif;font-weight: 600;}.ge{color: #fff;font-size: 16px;font-weight: 500;margin: 0px 10px;
}/* 顶部导航条end */

运行结果:

http://www.lryc.cn/news/469923.html

相关文章:

  • 信息安全入门——网络安全控制
  • 跟着鸟儿学飞行?扑翼机器人的感知秘籍
  • Python画笔案例-093 绘制 彩虹图
  • 【数据结构】贪心算法:决策的艺术
  • Linux LVS详解
  • LabVIEW显微镜自动对焦系统
  • 基于IP的真实地址生成器
  • 下面程序头的三个import语句可以合并或简化么?
  • 深度学习--CNN实现猫狗识别二分类(附带下载链接, 长期有效)
  • Depcheck——专门用于检测 JavaScript 和 Node.js 项目中未使用依赖项的工具
  • 前端构建工具vite的优势
  • hive查询语句
  • 【AIGC】2024-ECCV-ControlNet++:通过有效的一致性反馈改进条件控制
  • Mysql5.7变为GreatSQL 8.0.32-25过程中,SQL语句报错及解决方案
  • Qt 使用QAxObject将QTableView数据导出到Excel表格
  • fastGpt
  • 如何全方位应对服务可用性的挑战
  • 二进制方式部署k8s集群
  • Vivado时序报告七:Report Clock NetworkReport Clock Interaction详解
  • HarmonyOS 组件样式@Style 、 @Extend、自定义扩展(AttributeModifier、AttributeUpdater)
  • 信息安全工程师(73)网络安全风险评估过程
  • 在MacOS玩RPG游戏 - RPGViewerPlus
  • 2024.10.27 直接插入排序 非递归后序遍历(复杂版)
  • Ubuntu 22.04系统启动时自动运行ROS2节点
  • 张三进阶之路 | 基于Spring AOP的Log收集
  • ubuntu新装ubuntu,重启黑屏
  • 太极安全监控系统0.8
  • E-清楚姐姐的布告规划【01背包】
  • 哪款宠物空气净化器噪音低?希喂、美的、安德迈测评分享
  • 2024年10月23日第一部分