携程网首页案例制作(移动端)

技术选型

方案:采用单独制作移动页面方案

技术:布局采用flex布局

body样式

通常要设置最大宽度,最小宽度,水平居中,字体设置,背景颜色以及相关初始化

body {max-width: 540px;min-width: 320px;margin: 0 auto;font: normal 14px/1.5 Tahoma,"Lucida Grande",Verdana,"Microsoft Yahel",STXihei,hei;color: #000;background-color: #f2f2f2;overflow-x: hidden;-webkit-tap-highlight-color: transparent;
}

搜索模块

搜索模块是一个固定定位,它与父亲没有关系,只与视口有关,所以设定位置为水平居中时,要以视口为标准。固定定位的盒子要有宽度

.search-index {/* 固定定位跟父亲没有关系 它与视口有关(屏幕) */display: flex;position: fixed;top: 0;left: 50%;transform: translateX(-50%);/* 固定的盒子要有宽度 */width: 100%;height: 44px;max-width: 540px;min-width: 320px;
}
  • 左边为自适应,右边小盒子定宽定高,这就需要用到flex布局,给右边盒子顶宽定高,左边盒子不设置宽高,直接设置flex:1;即可,记得给父元素加flex属性,display:flex;
  • 右边小盒子由两个部分组成,可以只使用一个元素,给这个元素设置伪元素即可
  • 给伪元素设置宽度时,要先将其变为块级元素,之后给伪元素设置背景图即可,二倍背景图(精灵图)要先将原图等比例缩小一半,测定坐标,记得也要将原图设置background-size:原宽的一半 auto;
  • 设置文字水平居中以及颜色大小等等

        <a href="" class="user">我 的</a>
.user {width: 44px;height: 44px;background-color: aquamarine;font-size: 12px;text-align: center;color: #2eaae0;
}
.user::before {content: "";display: block;width: 23px;height: 23px;background: url(../images/sprite.png) no-repeat -59px -194px;background-size: 104px auto;margin: 4px auto -3px;
}
  • 左边搜索区域里的搜索也可用伪元素,同样使用精灵图,但使用伪元素时要将伪元素设置为块级元素,右边的文字就会被挤下去,此时伪元素可采取定位,之后将设置search的padding-left即可
  • 文字垂直居中使用line-height时,最好不要和高度相同,而要减去边框的高度,因为使用的时CSS3模型,边框不会扩大盒子,此时的内容区会变小,若使用原高度文字会偏下
 <div class="search-index"><div class="search">目的地/景点/酒店</div><a href="" class="user">我 的</a> </div>
.search {position: relative;height: 26px;border: 1px solid #ccc;flex: 1;align-self: center;margin: 0 10px;border-radius: 5px;font-size: 12px;color: #666;line-height: 24px;padding-left: 25px;box-shadow: 0 2px rgba(0,0,0,.2);border-top: 1px solid #ccc;border-bottom: 1px solid #ccc;
}
.search::before {position: absolute;top: 5px;left: 5px;content: "";display: block;width: 15px;height: 15px;background: url(../images/sprite.png) no-repeat -59px -279px;background-size: 104px auto;
}

焦点图区域

直接添加图片即可,但因为上面搜索区域是固定定位,不占据位置,下方图片某部分会被搜索区域覆盖住,因此要设置焦点图区域的padding-left使其往下方移动

local-nav 

常见flex布局思路

    <ul class="local-nav"><li><a href="" title="景点 玩乐"><span class="local-nav-icon"></span><span>景点 玩乐</span></a></li><li><a href="" title="景点 玩乐"><span class="local-nav-icon"></span><span>景点 玩乐</span></a></li><li><a href="" title="景点 玩乐"><span class="local-nav-icon"></span><span>景点 玩乐</span></a></li><li><a href="" title="景点 玩乐"><span class="local-nav-icon"></span><span>景点 玩乐</span></a></li><li><a href="" title="景点 玩乐"><span class="local-nav-icon"></span><span>景点 玩乐</span></a></li></ul>
.local-nav {display: flex;height: 64px;background-color: #fff;border-radius: 8px;margin: 3px 4px;
}
.local-nav li {flex: 1;
}
.local-nav a {display: flex;flex-direction: column;font-size: 12px;/* 侧轴居中 */align-items: center;
}
.local-nav-icon {margin-top: 8px;width: 32px;height: 32px;background: url(../images/localnav_bg.png) no-repeat 0 0;background-size: 32px;}

主导航栏

  •  将nav设置为flex,三个子元素设置flex:1;这样三个子元素会平分宽度
  • 第二个和第三个孩子也设置为flex,将主轴改为column,再让里面的儿子设置为flex;1;就可实现垂直平分
  • 接着向里面添加背景图和内容即可

背景线性渐变


语法1:
background:linear-gradient(起始方向,颜色1,颜色2,...);

background:-webkit-linear-gradient(left, red,blue);

background:-webkit-linear-gradient(left top,red,blue); 

  • 背景渐变必须添加浏览器私有前缀
  • 起始方向可以是:方位名词或者度数,如果省略默认就是top
    <style>div {width: 600px;height: 200px;/* 背景渐变必须添加浏览器私有前缀 */background: -webkit-linear-gradient(left,red,blue);}</style>
<body><div></div>
</body>

 

三个子盒子就用到了线性渐变。

 

    <div class="nav"><div class="nav-common"><div class="nav-items"><a href="">海外酒店</a></div><div class="nav-items"><a href="">海外酒店</a><a href="">特价酒店</a></div><div class="nav-items"><a href="">海外酒店</a><a href="">特价酒店</a></div></div><div class="nav-common"><div class="nav-items"><a href="">海外酒店</a></div><div class="nav-items"><a href="">海外酒店</a><a href="">特价酒店</a></div><div class="nav-items"><a href="">海外酒店</a><a href="">特价酒店</a></div></div><div class="nav-common"><div class="nav-items"><a href="">海外酒店</a></div><div class="nav-items"><a href="">海外酒店</a><a href="">特价酒店</a></div><div class="nav-items"><a href="">海外酒店</a><a href="">特价酒店</a></div></div></div>
.nav {border-radius: 8px;margin: 0 4px 3px;overflow: hidden;
}.nav-common {display: flex;height: 88px;background-color: #666;
}.nav-common .nav-items {flex: 1;display: flex;flex-direction: column;
}
.nav-items a {flex: 1;text-align: center;line-height: 44px;color: #fff;font-size: 14px;/* 文字阴影 */text-shadow: 1px 1px rgba(0,0,0,.2);
}
.nav-items a:nth-child(1) {border-bottom: 1px solid #fff;
}
.nav-items:nth-child(1) a {border: 0;background: url(..//images/hotel.png) no-repeat bottom center;background-size: 121px auto;
}
.nav-items:nth-child(-n+2) {border-right: 1px solid #fff;
}
.nav-common:nth-child(1) {background: -webkit-linear-gradient(left,#fa5a55,#fa994d);
}
.nav-common:nth-child(2) {margin: 3px 0;background: -webkit-linear-gradient(left,#4b90ed,#53bced);
}
.nav-common:nth-child(3) {background: -webkit-linear-gradient(left,#34c2a9,#6cd559);
}

侧导航栏

  • 侧导航栏的制作与local-nav相似,只是多了一个换行,将父级加上flow-wrap:wrap;
  • 子元素设置为flex:20%(相对于父元素)
  • 子元素里和local-nav里的子元素一样,将a设置为flex,将主轴改为column,侧边居中即可

 

    <div class="subnav-entry"><li><a href=""><span class="subnav-entry-icon"></span><span>电话费</span></a></li><li><a href=""><span class="subnav-entry-icon"></span><span>电话费</span></a></li><li><a href=""><span class="subnav-entry-icon"></span><span>电话费</span></a></li><li><a href=""><span class="subnav-entry-icon"></span><span>电话费</span></a></li><li><a href=""><span class="subnav-entry-icon"></span><span>电话费</span></a></li><li><a href=""><span class="subnav-entry-icon"></span><span>电话费</span></a></li><li><a href=""><span class="subnav-entry-icon"></span><span>电话费</span></a></li><li><a href=""><span class="subnav-entry-icon"></span><span>电话费</span></a></li><li><a href=""><span class="subnav-entry-icon"></span><span>电话费</span></a></li><li><a href=""><span class="subnav-entry-icon"></span><span>电话费</span></a></li></div>

 

.subnav-entry {display: flex;border-radius: 8px;background-color: #fff;margin: 0 4px;flex-wrap: wrap;
}.subnav-entry li {/* 里面的盒子可以写百分比 相对于父级来说的 */flex: 20%;
}.subnav-entry a {display: flex;flex-direction: column;align-items: center;
}.subnav-entry-icon {width: 28px;height: 28px;margin-top: 4px;background: url(../images/subnav-bg.png) no-repeat;background-size: 28px auto;
}

 销售模块

  • 分为头部和身体,头部热门活动因为SEO优化先写文字,再利用首行缩进将文字隐藏,利用定位添加伪元素设置背景,伪元素添加定位之后就变成行内块元素了,故不需要将其变为块级元素。
  • 三角的CSS制作,显示出右边框和下边框,瞬时针旋转45度即可。
  • 下面图片区域使用flex布局,里面两个a元素,a元素均flex:1;就能水平平均分布。添加边框即可

整体代码:

<!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="./CSS/normalize.css"><link rel="stylesheet" href="./CSS/index.css">
</head><body><div class="search-index"><div class="search">目的地/景点/酒店</div><a href="" class="user">我 的</a></div><!-- 焦点图模块 --><div class="focus"><img src="./upload/focus.jpg" alt=""></div><!-- local-nav --><ul class="local-nav"><li><a href="" title="景点 玩乐"><span class="local-nav-icon"></span><span>景点 玩乐</span></a></li><li><a href="" title="景点 玩乐"><span class="local-nav-icon"></span><span>景点 玩乐</span></a></li><li><a href="" title="景点 玩乐"><span class="local-nav-icon"></span><span>景点 玩乐</span></a></li><li><a href="" title="景点 玩乐"><span class="local-nav-icon"></span><span>景点 玩乐</span></a></li><li><a href="" title="景点 玩乐"><span class="local-nav-icon"></span><span>景点 玩乐</span></a></li></ul><!-- nav --><div class="nav"><div class="nav-common"><div class="nav-items"><a href="">海外酒店</a></div><div class="nav-items"><a href="">海外酒店</a><a href="">特价酒店</a></div><div class="nav-items"><a href="">海外酒店</a><a href="">特价酒店</a></div></div><div class="nav-common"><div class="nav-items"><a href="">海外酒店</a></div><div class="nav-items"><a href="">海外酒店</a><a href="">特价酒店</a></div><div class="nav-items"><a href="">海外酒店</a><a href="">特价酒店</a></div></div><div class="nav-common"><div class="nav-items"><a href="">海外酒店</a></div><div class="nav-items"><a href="">海外酒店</a><a href="">特价酒店</a></div><div class="nav-items"><a href="">海外酒店</a><a href="">特价酒店</a></div></div></div><!-- subnav-entry --><div class="subnav-entry"><li><a href=""><span class="subnav-entry-icon"></span><span>电话费</span></a></li><li><a href=""><span class="subnav-entry-icon"></span><span>电话费</span></a></li><li><a href=""><span class="subnav-entry-icon"></span><span>电话费</span></a></li><li><a href=""><span class="subnav-entry-icon"></span><span>电话费</span></a></li><li><a href=""><span class="subnav-entry-icon"></span><span>电话费</span></a></li><li><a href=""><span class="subnav-entry-icon"></span><span>电话费</span></a></li><li><a href=""><span class="subnav-entry-icon"></span><span>电话费</span></a></li><li><a href=""><span class="subnav-entry-icon"></span><span>电话费</span></a></li><li><a href=""><span class="subnav-entry-icon"></span><span>电话费</span></a></li><li><a href=""><span class="subnav-entry-icon"></span><span>电话费</span></a></li></div><!-- 销售模块 --><div class="sale-box"><div class="sales-hd"><h2>热门活动</h2><a href="" class="more">获取更多福利</a></div><div class="sales-bd"><div class="row"><a href=""><img src="./upload/pic1.jpg" alt=""></a><a href=""><img src="./upload/pic2.jpg" alt=""></a></div><div class="row"><a href=""><img src="./upload/pic3.jpg" alt=""></a><a href=""><img src="./upload/pic4.jpg" alt=""></a></div><div class="row"><a href=""><img src="./upload/pic5.jpg" alt=""></a><a href=""><img src="./upload/pic6.jpg" alt=""></a></div></div></div>
</body></html>
body {max-width: 540px;min-width: 320px;margin: 0 auto;font: normal 14px/1.5 Tahoma, "Lucida Grande", Verdana, "Microsoft Yahel", STXihei, hei;color: #000;background-color: #f2f2f2;overflow-x: hidden;-webkit-tap-highlight-color: transparent;
}div {box-sizing: border-box;
}a {text-decoration: none;color: #222;
}li {list-style: none;margin: 0;padding: 0;
}/* 搜索模块 */
.search-index {/* 固定定位跟父亲没有关系 它与视口有关(屏幕) */display: flex;position: fixed;top: 0;left: 50%;transform: translateX(-50%);/* 固定的盒子要有宽度 */width: 100%;height: 44px;max-width: 540px;min-width: 320px;
}.search {position: relative;height: 26px;border: 1px solid #ccc;flex: 1;align-self: center;margin: 0 10px;border-radius: 5px;font-size: 12px;color: #666;line-height: 24px;padding-left: 25px;box-shadow: 0 2px rgba(0, 0, 0, .2);background-color: #f6f6f6;border-top: 1px solid #ccc;border-bottom: 1px solid #ccc;
}.search::before {position: absolute;top: 5px;left: 5px;content: "";display: block;width: 15px;height: 15px;background: url(../images/sprite.png) no-repeat -59px -279px;background-size: 104px auto;
}.user {width: 44px;height: 44px;font-size: 12px;text-align: center;color: #2eaae0;
}.user::before {content: "";display: block;width: 23px;height: 23px;background: url(../images/sprite.png) no-repeat -59px -194px;background-size: 104px auto;margin: 4px auto -3px;
}/* focus */
.focus {padding-top: 44px;
}.focus img {width: 100%;
}.local-nav {display: flex;height: 64px;background-color: #fff;border-radius: 8px;margin: 3px 4px;
}.local-nav li {flex: 1;
}.local-nav a {display: flex;flex-direction: column;font-size: 12px;/* 侧轴居中 */align-items: center;
}.local-nav-icon {margin-top: 8px;width: 32px;height: 32px;background: url(../images/localnav_bg.png) no-repeat 0 0;background-size: 32px;}/* nav */
.nav {border-radius: 8px;margin: 0 4px 3px;overflow: hidden;
}.nav-common {display: flex;height: 88px;background-color: #666;
}.nav-common .nav-items {flex: 1;display: flex;flex-direction: column;
}.nav-items a {flex: 1;text-align: center;line-height: 44px;color: #fff;font-size: 14px;/* 文字阴影 */text-shadow: 1px 1px rgba(0, 0, 0, .2);
}.nav-items a:nth-child(1) {border-bottom: 1px solid #fff;
}.nav-items:nth-child(1) a {border: 0;background: url(..//images/hotel.png) no-repeat bottom center;background-size: 121px auto;
}.nav-items:nth-child(-n+2) {border-right: 1px solid #fff;
}.nav-common:nth-child(1) {background: -webkit-linear-gradient(left, #fa5a55, #fa994d);
}.nav-common:nth-child(2) {margin: 3px 0;background: -webkit-linear-gradient(left, #4b90ed, #53bced);
}.nav-common:nth-child(3) {background: -webkit-linear-gradient(left, #34c2a9, #6cd559);
}.subnav-entry {display: flex;border-radius: 8px;background-color: #fff;margin: 0 4px;flex-wrap: wrap;padding: 5px 0;
}.subnav-entry li {/* 里面的盒子可以写百分比 相对于父级来说的 */flex: 20%;
}.subnav-entry a {display: flex;flex-direction: column;align-items: center;
}.subnav-entry-icon {width: 28px;height: 28px;margin-top: 4px;background: url(../images/subnav-bg.png) no-repeat;background-size: 28px auto;
}
/* sales-box */
.sales-box {border-top: 1px solid #bbb;background-color: #fff;margin: 0 4px;
}
.sales-hd {position: relative;height: 44px;border-bottom: 1px solid #ccc;
}
.sales-hd h2 {position: relative;text-indent: -999px;overflow: hidden;
}
.sales-hd h2::after {position: absolute;top: 8px;left: 20px;content: "";width: 79px;height: 15px;background: url(../images/hot.png) no-repeat 0 -20px;background-size: 79px auto;
}
.sales-hd .more {position: absolute;top: 8px;right: 5px;border-radius: 8px;padding: 3px 20px 3px 10px;color: #fff;font-size: 12px;background: -webkit-linear-gradient(left,#ff506c,#ff68c6);
}
.more::after {content: "";position: absolute;/* 定位改变行内块 */top: 9px;right: 9px;width: 7px;height: 7px;border-top: 2px solid #fff;border-right: 2px solid #fff;transform: rotate(45deg);
}
.row {display: flex;
}
.row a {flex: 1;border-bottom: 1px solid #ccc;
}
.row a:nth-child(1) {border-right: 1px solid #ccc;
}
.row a img {width: 100%;
}body {max-width: 540px;min-width: 320px;margin: 0 auto;font: normal 14px/1.5 Tahoma, "Lucida Grande", Verdana, "Microsoft Yahel", STXihei, hei;color: #000;background-color: #f2f2f2;overflow-x: hidden;-webkit-tap-highlight-color: transparent;
}div {box-sizing: border-box;
}a {text-decoration: none;color: #222;
}li {list-style: none;margin: 0;padding: 0;
}/* 搜索模块 */
.search-index {/* 固定定位跟父亲没有关系 它与视口有关(屏幕) */display: flex;position: fixed;top: 0;left: 50%;transform: translateX(-50%);/* 固定的盒子要有宽度 */width: 100%;height: 44px;max-width: 540px;min-width: 320px;
}.search {position: relative;height: 26px;border: 1px solid #ccc;flex: 1;align-self: center;margin: 0 10px;border-radius: 5px;font-size: 12px;color: #666;line-height: 24px;padding-left: 25px;box-shadow: 0 2px rgba(0, 0, 0, .2);background-color: #f6f6f6;border-top: 1px solid #ccc;border-bottom: 1px solid #ccc;
}.search::before {position: absolute;top: 5px;left: 5px;content: "";display: block;width: 15px;height: 15px;background: url(../images/sprite.png) no-repeat -59px -279px;background-size: 104px auto;
}.user {width: 44px;height: 44px;font-size: 12px;text-align: center;color: #2eaae0;
}.user::before {content: "";display: block;width: 23px;height: 23px;background: url(../images/sprite.png) no-repeat -59px -194px;background-size: 104px auto;margin: 4px auto -3px;
}/* focus */
.focus {padding-top: 44px;
}.focus img {width: 100%;
}.local-nav {display: flex;height: 64px;background-color: #fff;border-radius: 8px;margin: 3px 4px;
}.local-nav li {flex: 1;
}.local-nav a {display: flex;flex-direction: column;font-size: 12px;/* 侧轴居中 */align-items: center;
}.local-nav-icon {margin-top: 8px;width: 32px;height: 32px;background: url(../images/localnav_bg.png) no-repeat 0 0;background-size: 32px;}/* nav */
.nav {border-radius: 8px;margin: 0 4px 3px;overflow: hidden;
}.nav-common {display: flex;height: 88px;background-color: #666;
}.nav-common .nav-items {flex: 1;display: flex;flex-direction: column;
}.nav-items a {flex: 1;text-align: center;line-height: 44px;color: #fff;font-size: 14px;/* 文字阴影 */text-shadow: 1px 1px rgba(0, 0, 0, .2);
}.nav-items a:nth-child(1) {border-bottom: 1px solid #fff;
}.nav-items:nth-child(1) a {border: 0;background: url(..//images/hotel.png) no-repeat bottom center;background-size: 121px auto;
}.nav-items:nth-child(-n+2) {border-right: 1px solid #fff;
}.nav-common:nth-child(1) {background: -webkit-linear-gradient(left, #fa5a55, #fa994d);
}.nav-common:nth-child(2) {margin: 3px 0;background: -webkit-linear-gradient(left, #4b90ed, #53bced);
}.nav-common:nth-child(3) {background: -webkit-linear-gradient(left, #34c2a9, #6cd559);
}.subnav-entry {display: flex;border-radius: 8px;background-color: #fff;margin: 0 4px;flex-wrap: wrap;padding: 5px 0;
}.subnav-entry li {/* 里面的盒子可以写百分比 相对于父级来说的 */flex: 20%;
}.subnav-entry a {display: flex;flex-direction: column;align-items: center;
}.subnav-entry-icon {width: 28px;height: 28px;margin-top: 4px;background: url(../images/subnav-bg.png) no-repeat;background-size: 28px auto;
}
/* sales-box */
.sales-box {border-top: 1px solid #bbb;background-color: #fff;margin: 0 4px;
}
.sales-hd {position: relative;height: 44px;border-bottom: 1px solid #ccc;
}
.sales-hd h2 {position: relative;text-indent: -999px;overflow: hidden;
}
.sales-hd h2::after {position: absolute;top: 8px;left: 20px;content: "";width: 79px;height: 15px;background: url(../images/hot.png) no-repeat 0 -20px;background-size: 79px auto;
}
.sales-hd .more {position: absolute;top: 8px;right: 5px;border-radius: 8px;padding: 3px 20px 3px 10px;color: #fff;font-size: 12px;background: -webkit-linear-gradient(left,#ff506c,#ff68c6);
}
.more::after {content: "";position: absolute;/* 定位改变行内块 */top: 9px;right: 9px;width: 7px;height: 7px;border-top: 2px solid #fff;border-right: 2px solid #fff;transform: rotate(45deg);
}
.row {display: flex;
}
.row a {flex: 1;border-bottom: 1px solid #ccc;
}
.row a:nth-child(1) {border-right: 1px solid #ccc;
}
.row a img {width: 100%;
}

最后加上通用样式即可。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://xiahunao.cn/news/2774744.html

如若内容造成侵权/违法违规/事实不符,请联系瞎胡闹网进行投诉反馈,一经查实,立即删除!

相关文章

Spring Boot 笔记 002 整合mybatis做数据库读取

概念 MyBatis 是一款优秀的持久层框架&#xff0c;它支持自定义 SQL、存储过程以及高级映射。MyBatis 免除了几乎所有的 JDBC 代码以及设置参数和获取结果集的工作。MyBatis 可以通过简单的 XML 或注解来配置和映射原始类型、接口和 Java POJO&#xff08;Plain Old Java Objec…

MySQL之体系结构

华子目录 MySQL简介MySQL的特性MySQL版本MySQL常见版本 数据库排名网站MySQL结构体系查看最大连接数查询缓存配置情况 一条SQL语句执行流程 MySQL简介 MySQL是一个小型关系数据库管理系统&#xff0c;开发者为瑞典MySQL AB公司。在2008年1月16号被sun公司10亿美金收购。2009年…

RNN(神经网络)

目录 介绍&#xff1a; 数据&#xff1a; 模型&#xff1a; 预测&#xff1a; 介绍&#xff1a; RNN&#xff0c;全称为循环神经网络&#xff08;Recurrent Neural Network&#xff09;&#xff0c;是一种深度学习模型&#xff0c;它主要用于处理和分析序列数据。与传统…

STM32启动过程浅析

MAP文件浅析 MDK编译过程文件&#xff08;11种&#xff09; .o&#xff1a;可重定向对象文件&#xff0c;每个.c、.s文件编译后都生成一个.o文件.axf&#xff1a;可执行对象文件&#xff0c;由.o文件链接生成&#xff0c;仿真的时候需要用到此文件.hex&#xff1a;INTEL Hex格…

[算法前沿]--058- LangChain 构建 LLM 应用详细教程

什么是LLMs? LLM,即大型语言模型,是指经过大量文本数据训练的最先进的语言模型。它利用深度学习技术来理解和生成类似人类的文本,使其成为各种应用程序的强大工具,例如文本完成、语言翻译、情感分析等。LLMs最著名的例子之一是 OpenAI 的 GPT-3,它因其语言生成能力而受到…

HTTP2: springboot启用http2

springboot http2应用条件 使用servlet 4.0jdk 9tomcat 9 springboot 开启h2 创建证书 创建脚本&#xff1a; keytool -genkey -keyalg RSA -alias wisely -keystore keystore.jks -storepass pass1234 -validity 4000 -keysize 2048添加springboot配置 server:port: 808…

Sentinel 源码分析

Sentinel源码分析 项目源码 1.Sentinel的基本概念 Sentinel实现限流、隔离、降级、熔断等功能&#xff0c;本质要做的就是两件事情&#xff1a; 统计数据&#xff1a;统计某个资源的访问数据&#xff08;QPS、RT等信息&#xff09;规则判断&#xff1a;判断限流规则、隔离规…

NGINX upstream、stream、四/七层负载均衡以及案例示例

文章目录 前言1. 四/七层负载均衡1.1 开放式系统互联模型 —— OSI1.2 四/七层负载均衡 2. Nginx七层负载均衡2.1 upstream指令2.2 server指令和负载均衡状态与策略2.2.1 负载均衡状态2.2.2 负载均衡策略 2.3 案例 3. Nginx四层负载均衡的指令3.1 stream3.2 upstream指令3.3 四…

油猴脚本开发总结

一、在线安装 打开浏览器&#xff0c;点击右上角“ ”&#xff0c;在弹出的菜单上点击“拓展”跳转到下面这个页面&#xff1a; 点击"获取Microsoft Edge拓展"&#xff1a; 然后搜索框输入“tampermonkey”&#xff1a; 获取最上面这个黑绿色拓展&#xff1a; 二、…

vulnhub中Beelzebub靶机

渗透思路 一.信息收集1.网段探测2.端口探测3.常见漏洞扫描4.目录扫描5.web页面分析 二.渗透继续目录扫描ssh连接提权提权&#xff0c;flag 一.信息收集 1.网段探测 ┌──(root㉿kali)-[~] └─# nmap -Pn 192.168.0.0/24 --min-rate 10000 Starting …

java实现栈功能

1.使用数组方式 public static void main(String[] args) throws Exception {BufferedReader br new BufferedReader(new InputStreamReader(System.in));int operateNum Integer.parseInt(br.readLine());//操作次数String inputInfo;//输入信息StringBuilder outputSb new…

吉他学习:右手拨弦方法,右手拨弦训练 左手按弦方法

第六课 右手拨弦方法https://m.lizhiweike.com/lecture2/29362775 第七课 右手拨弦训练https://m.lizhiweike.com/lecture2/29362708

SDL库的下载与配置(Visual Studio )2024/2/4更新

一.SDL的下载 下载链接 二.SDL的环境配置 解压以后放在中文路径下 不会添加环境变量自行搜索&#xff08;比较简单网上教程很多&#xff09; 下面进行编译器的配置 复制这段内容 x64\SDL2main.lib x64\SDL2.lib将这段代码放进去运行一下 #include <SDL.h>int main(int…

07-使用Package、Crates、Modules管理项目

上一篇&#xff1a;06-枚举和模式匹配 当你编写大型程序时&#xff0c;组织代码将变得越来越重要。通过对相关功能进行分组并将具有不同功能的代码分开&#xff0c;您可以明确在哪里可以找到实现特定功能的代码&#xff0c;以及在哪里可以改变功能的工作方式。 到目前为止&…

量子计算+材料建模的理论效率提升100000倍!英国公司Phasecraft取得算法突破

编辑丨慕一 编译/排版丨沛贤 深度好文&#xff1a;1250字丨6分钟阅读 在量子计算近期可能的商业应用中&#xff0c;材料建模最有前景的领域之一。在这个领域的应用可能只需要几千个量子比特&#xff0c;而不像其他应用需要数百万个量子比特。目前该领域是量子计算的研究热点…

大规模块存储 EC 系统构建

本文整理自 2023 年 7 月 DataFunSummit 2023 数据基础架构峰会——大规模存储架构分论坛的同名主题分享。 非常欢迎大家的到来&#xff0c;今天由我来分享百度智能云块存储 EC 系统的构建。块存储系统在百度智能云的产品名叫 CDS&#xff0c;底层 EC 系统由 Aries 承担。 今天…

JavaScript基础(28)_获取元素的其他样式

其他样式操作的属性 clientWidth(只读)&#xff1a;获取元素的"可见宽度"&#xff0c;包括内容区和内边距(返回的是一个数字&#xff0c;不带px&#xff0c;可直接进行计算)。 clientHeight(只读)&#xff1a;获取元素的"可见高度"&#xff0c;包括内容区…

nodeJS 的 npm 设置国内高速镜像之淘宝镜像的方法

1、我们知道 nodeJS 是老外搞出来的&#xff0c;服务器放在了国外&#xff0c;国内的小朋友访问起来会比较慢&#xff0c;阿里巴巴的淘宝给出了有力支持&#xff0c;现在我们就将 nodeJS 的镜像地址切换为国内的淘宝镜像。 2、查看当前的镜像地址&#xff1a; npm get registr…

高级FPGA开发之基础协议PCIe(二)

高级FPGA开发之基础协议之PCIe&#xff08;二&#xff09; 一、TLP报文类型 在PCIe总线中&#xff0c;存储器读写、I/O读写和配置读写请求TLP主要由以下几类报文组成&#xff1a; 1.1 存储器读请求TLP和读完成TLP 当PCIe主设备&#xff08;RC或者EP&#xff09;访问目标设备…

立面效果图为何要用云渲染100?渲染100邀请码1a12

建筑设计是一门艺术&#xff0c;而立面效果图是艺术的展现&#xff0c;它在设计中非常重要。 1、立面效果图的重要性 立面效果图能用来展示建筑物的风格、材质、色彩以及环境等因素&#xff0c;通过它&#xff0c;设计师可以检验项目质量&#xff0c;评估效果是否达到预期&…