HTML+CSS制作的纯静态网页

article/2025/9/25 7:26:05

刚学完HTML+CSS,一定要按照自己的想法去制作网页,虽然没有交互,但是可以对前面的知识有一个很大的重用,你的知识框架会更加完美。css基础html是勾勒,css是染色,基础的css学完你会有种想写页面的冲动,这时候你不用抑制住那种感觉(我就没压住哈哈),直接按照自己所想开写,这是你的第一个项目,从期末就一直想学Web前端设计,现在刚放假4天,自己也是真真正正的看了4天慕课,大体过了一遍HTML,CSS,我想我是不是也可以画一些东西了?尝试一下总比没有好,踏出第一步虽然很菜!

因为喜欢长跑,喜欢基普乔格和贝克勒,也很想买Nike Next%和佳明,但是没有钱啊,我没有钱。
在这里插入图片描述
就只能用另一种形式去假装拥有Nike Next%和佳明了——设计一个全都是Nike Next%和佳明基普乔格和贝克勒的小网页

在这里插入图片描述


下面是具体的展示:
在这里插入图片描述
这个视频有广告还是先看代码吧:

纯HTML+CSS无交互静态网页展示(菜鸡)

开始拥有Next%和佳明之旅:

0. 寻找素材
在所有的所有开始之前,我们要先找到自己的方向,自己想做什么,要实现什么功能,需要什么资源,什么素材(哈哈我这个就不用想了,我只想假装拥有Next%和佳明)。在Baidu上找了一些图片:
在这里插入图片描述
1. 设计框架
在正式开始是制作之前,我们要有一个总的框架,在这个框架上去设计样式,额,用什么去设计框架呢?啊,电脑上没有绘图软件,又不想去下载,只能用Excel画框架了.
(1)首先要有一个总的区域container在这个总的区域里设置子区域.
(2)接着要有一个导航栏nav,设置在最顶部,横占整个区域.
(3)再往下就是两侧的菜单,aside1和aside2,aside里面又分为三个小区域,用来展示内容
(4)中间就是主体部分main,main由多个相同的cbox组成,第一个cbox里面设置动画,接下来的cbox用来展示商品.
(5)在区域的底部设置一个页脚footer,展示温馨提示或者作者信息.
在这里插入图片描述
画了一个框架,感觉还不错,将就着用吧。这个框架大概就是按照CSDN的主页来设计的,完全按照自己看到的,导航栏,两面的菜单,中间是具体的内容。嗯,感觉还不错.

2. 有了框架,开始搭HTML
每一个区域都是一个盒子,每个盒子可以设置样式。一个大盒子里面浮动或者定位几个小盒子,小盒子里面设置具体内容。

<!DOCTYPE html>
<html>
<head><meta charset="utf-8"><title>Web run</title><link rel="stylesheet" type="text/css"href="CSS/Web run.css">
</head>
<body><div id="container"><div id="nav"><div id="name"><p>Hello! One of three_tigers</p></div><div id="search"><div id="dd1">search<input type="text"/></div><div id="dd2"><img src="images/run/search.png" width="40" height="35"></div></div><div id="setting"><p>setting</p><div><img src="images/run/nav4.png" width="35" height="35"></div>			</div><div id="theme"><p>theme</p><div><img src="images/run/theme.png" width="40" height="35"></div>	</div></div><div id="aside1"><div class="box"><div class="abox"><img src="images/run/Kipchoge2.png" width="360" height="255"></div><div class="bbox"><h2>埃鲁德·基普乔格,肯尼亚马拉松运动员,自从19岁在2003年的世界田径锦标赛赛上获得5000米的金牌之后,就成为了国际田坛一颗耀眼的明星。肯尼亚全国上下欢腾鼓舞,很快奈洛比市就有一条街道以他的名字命名,用来纪念这次伟大的胜利。</h2></div></div><div class="box"><div class="abox"><img src="images/run/Kipchoge1.png" width="360" height="255"></div><div class="bbox"><h2>2018年9月16日,在柏林马拉松上基普乔格以2小时01分39秒夺冠并创造了新的马拉松世界纪录 [1]  ;12月,被新华社体育部评为2018年国际十佳运动员。</h2></div>	</div><div class="box"><div class="abox"><img src="images/run/Kipchoge3.png" width="360" height="255"></div><div class="bbox"><h2>2019年10月12日,在奥地利首都维也纳的“Ineos 1:59”的挑战中以1小时59分40秒的成绩顺利完赛,就此成为全球第一位马拉松跑进两小时大关的选手。</h2></div>				</div></div><div id="main"><div class="cbox"><div id="fbox"></div></div><div class="cbox"><div class="pbox"><img src="images/run/Next%1.png" width="450" height="250"></div><div class="ebox"><div class="explain">Nike official Nike ZOOMX VAPORFLY NEXT% men's/women's running shoes.	Nike is undoubtedly the best choice for beginners. Even its entry-level running shoes have good performance. </div><div class="price"><a href="#">$600 Buy it now!</a></div></div></div><div class="cbox"><div class="pbox"><img src="images/run/Next%3.png" width="450" height="250"></div><div class="ebox"><div class="explain">Nike official Nike ZOOMX VAPORFLY NEXT% men's/women's running shoes.	Nike is undoubtedly the best choice for beginners. Even its entry-level running shoes have good performance. </div><div class="price"><a href="#">$600 Buy it now!</a></div></div></div><div class="cbox"><div class="pbox"><img src="images/run/佳明2.png" width="450" height="250"></div><div class="ebox"><div class="explain">Grasp every moment, to the minute to chase, explore the infinite possibilities in life.From scratch, forge ahead, Garmin, challenge you yesterday!</div><div class="price"><a href="#">$600 Buy it now!</a></div></div></div>			<div class="cbox"><div class="pbox"><img src="images/run/佳明1.png" width="450" height="250"></div><div class="ebox"><div class="explain">Grasp every moment, to the minute to chase, explore the infinite possibilities in life.From scratch, forge ahead, Garmin, challenge you yesterday!</div><div class="price"><a href="#">$600 Buy it now!</a></div></div></div><div class="cbox"><div class="pbox"><img src="images/run/Next%1.png" width="450" height="250"></div><div class="ebox"><div class="explain">Nike official Nike ZOOMX VAPORFLY NEXT% men's/women's running shoes.	Nike is undoubtedly the best choice for beginners. Even its entry-level running shoes have good performance. </div><div class="price"><a href="#">$600 Buy it now!</a></div></div></div><div class="cbox"><div class="pbox" width="450" height="250"><img src="images/run/佳明3.png" width="450" height="250"></div><div class="ebox"><div class="explain">Grasp every moment, to the minute to chase, explore the infinite possibilities in life.From scratch, forge ahead, Garmin, challenge you yesterday!</div><div class="price"><a href="#">$600 Buy it now!</a></div></div></div>			<div class="cbox"><div class="pbox"><img src="images/run/Next%2.png" width="450" height="250"></div><div class="ebox"><div class="explain">Nike official Nike ZOOMX VAPORFLY NEXT% men's/women's running shoes.	Nike is undoubtedly the best choice for beginners. Even its entry-level running shoes have good performance. </div><div class="price"><a href="#">$600 Buy it now!</a></div></div></div><div class="cbox"><div class="pbox"><img src="images/run/Nike1.png" width="450" height="250"></div><div class="ebox"><div class="explain">Grasp every moment, to the minute to chase, explore the infinite possibilities in life.From scratch, forge ahead, Garmin, challenge you yesterday!</div><div class="price"><a href="#">$600 Buy it now!</a></div></div></div></div><div id="aside2"><div class="box"><div class="abox"><img src="images/run/贝克勒1.png" width="360" height="255"></div><div class="bbox"><h2>埃塞俄比亚长跑运动员,拥有世界纪录和奥运会纪录。在5000米和10000米,他是这两个赛事的奥运卫冕冠军,2004年雅典奥运会10000米冠军,2008年北京奥运会5000米和10000米金牌。</h2></div>				</div><div class="box"><div class="abox"><img src="images/run/贝克勒2.png" width="360" height="255"></div><div class="bbox"><h2>凯内尼萨·贝克勒,在田径届被称为万米之王,他的技术动作富有弹性,频率相当快,往往能最后一圈进行决胜,在国际赛场9年的万米比赛中尚未尝过败绩,无愧于万米之王称号。</h2></div>				</div><div class="box"><div class="abox"><img src="images/run/贝克勒3.png" width="360" height="255"></div><div class="bbox"><h2>2004年雅典奥运会,10000米金牌、5000米银牌。
2008年北京奥运会,5000米金牌、10000米金牌。
共取得金牌3枚,银牌1枚。</h2></div>				</div></div><div id="footer"> <div id="maker">Made by One of thre_tigers</div>			<div id="goback"><a href="#">Go back to top</a></div><div id="service"><div><p>Sevice</p></div><div><img src="images/run/phone.png " width="40" height="40"></div></div></div></div>
</body>
</html>

这个过程就是对着自己的“框架”翻译一遍结构,乖乖用div累起来就ok啦.

3. 用CSS设置样式
把结构设置好之后,就是给每一个区域设置样式了,这也是最关键的一步,在这里我要设置的样式主要是:
(1)导航栏nav里面的图标: 边框有透明以及圆角效果,一个搜索框,鼠标悬浮放大的效果,以及旁边的阴影。
(2) 两侧菜单aside**: 图片边框透明,阴影,圆角,鼠标悬浮能够翻转这个区域,展示图片背面的人物介绍
(3)主体部分的mian:
第一个cbox中间边框有圆角,阴影效果,同时在中间播放动画。接下来的cbox分为两个部分,分别展示商品图片和商品介绍,也是边框有透明以及圆角效果,右侧有一个价格框,显示价格填入超链接。同时鼠标悬浮有放大,阴影的效果。
(4)页脚footer : 里面的图标,边框有透明以及圆角效果,鼠标悬浮放大的效果,以及旁边的阴影。

下面看具体实现:
1. 导航栏nav:
要实现的样式:导航栏nav里面的4图标区域(name search setting theme),边框有透明以及圆角效果,一个搜索框,鼠标悬浮放大的效果,以及旁边的阴影。

#nav{background-color: #484891;width: 1500px;height: 50px;border: 1px solid white;position: fixed;z-index: 999;
}#name{width: 350px;height: 40px;color: white;text-align:center;font-size: 25px;border: 1px solid white;border-radius: 10px;margin-top: 5px;float: left;margin-right: 70px;
}
#name:hover{
transform: scale(1.3);
box-shadow: 0px 0px 10px white;
}#search{width: 430px;height: 40px;color: white;text-align:center;font-size: 25px;border: 1px solid white;border-radius: 10px;margin-top: 5px;float: left;margin-right: 70px;
}#search div{
margin-left: 10px;
margin-right: 5px;
}#dd1{margin-top: 0px;float: left;
}
#dd2{margin-top:5px;float: left;
}#search:hover{transform: scale(1.3);box-shadow: 0px 0px 10px white;
}#setting{width: 220px;height: 40px;color: white;text-align:center;font-size: 25px;border: 1px solid white;border-radius: 10px;margin-top: 5px;float: left;margin-right: 70px;
}
#setting p{display: inline;
}#setting div{width: 35px;height: 30px;float: right;margin-right:30px;border: 1px solid #484891; margin-top: 2px;
}#setting:hover{transform: scale(1.3);box-shadow: 0px 0px 10px white;
}
#theme{width: 220px;height: 40px;color: white;text-align:center;font-size: 25px;border: 1px solid white;border-radius: 10px;margin-top: 5px;float: left;margin-right: 50px;
}
#theme p{display: inline;
}#theme div{width: 35px;height: 30px;float: right;margin-right:30px;border: 1px solid #484891; margin-top: 2px;
}#theme:hover{transform: scale(1.3);box-shadow: 0px 0px 10px white;
}

几个要注意的地方:
(1)鼠标悬停时放大:transform: scale(1.3);
(2)阴影的设置用:box-shadow: 0px 0px 10px white;
(3)在设置text+div的区域时,如果把文本用< p >标签设置,那么他默认的是block类型的,会占据一行,所以装照片的div会展示在下一行,这个时候可以将< p >标签转化成inline类型:
#theme p{display: inline;}
(4)搜索框:左侧文字用< p >标签包络,中间设置一个文本框< input type=“text” />,右侧用一个div区域

2. 两侧的图片菜单:
实现功能:两侧菜单aside图片边框透明,阴影,圆角,鼠标悬浮能够翻转这个区域,展示图片背面的人物介绍

#aside1{background-color: #484891;width: 375px;height: 800px;border:1px solid white;float:left;position: fixed;left:0px;top: 55px;overflow: hidden;border-radius: 10px;
}#aside2{background-color: #484891;width: 375px;height: 800px;border:1px solid white;float:left;position: fixed;left:1120px;top: 55px;overflow: hidden;border-radius: 10px;
}
.box{width: 360px;height: 255px;border:1px solid white;margin: 6px auto;transform-style: preserve-3d;transition: 1s;border-radius: 10px;line-height: 40px;
}
.box:hover{transform: rotateY(180deg);box-shadow: 0px 0px 10px white;
}
.abox{width: 360px;height: 255px;border:1px solid #336666;position: absolute;overflow: hidden;border-radius: 10px;
}
.bbox{background-color:#080000;width: 360px;height: 255px;border:1px solid #336666;transform: rotateY(180deg);overflow: hidden;border-radius: 10px;
}
.bbox h2{text-align: center;font-size: 15px;text-align: center;color: 	#808000;
}

这里要实现的主要是一个鼠标悬停翻转的功能,我们可以这样来设置:
(1)对展示区域box设置两个和box等大的子区域abox和bbox分别表示正面和背面,abox设置图片,bbox设置人物介绍.
(2)将box区域先沿着Y轴旋转180deg.
(3)将abox的position设置为absolute,这样abox就会脱离文档流,不会占据空间而bbox就会填补上去,实现a在b的表层.
(4)鼠标悬停的时候将box反转过来就可以看到背面bbox了.

3.main中心区域:
(1)第一个cbox中间边框有圆角,阴影效果,同时在中间播放动画。
动画的设置主要使用@keyframes规则:

@keyframes frames{0% {background:  url("../images/run/freedom.png")  repeat; }20% {background:  url("../images/run/keep.png")  repeat; }40% {background:  url("../images/run/keep1.png")  repeat; }60% {background:  url("../images/run/Nike logo.png")  repeat; }80% {background:  url("../images/run/亚瑟士logo.png")  repeat; }100% {background:  url("../images/run/佳明logo.png")  repeat; }
}

将图片设置好,然后在中心的fbox里使用:

#fbox{width: 710px;height: 250px;border:1px solid white;	box-shadow: 3px 3px 5px white;margin: 2px auto;border-radius: 10px;animation: frames 50s linear;
}

(2)接下来的cbox分为两个部分,分别展示商品图片和商品介绍,也是边框有透明以及圆角效果,右侧有一个价格框,显示价格填入超链接。同时鼠标悬浮有放大,阴影的效果。
边框设置成圆角,看上去更加圆润,精致,使用border-radius设置:

.pbox{width: 450px;height: 250px;border:1px solid rgb(40 40 40);	float:left;margin-left: 5px;margin-top: 4px;border-radius: 10px;overflow: hidden;
}

鼠标悬浮的时候将图标放大,然后让边框显示白色,加上阴影这个时候看上去就会有一种透明的效果:

.pbox:hover{transform: scale(1.1);border:2px solid white;border: 1px solid white;box-shadow: 0px 0px 5px white;
}

下面是mian区域的代码:

#main{background-color:#282828;width: 740px;height: 2435px;border:1px solid white;position: absolute;left:380px;top: 55px;z-index:0;
}.cbox{width: 730px;height: 260px;margin: 8px auto;clear: both;
}#fbox{width: 710px;height: 250px;border:1px solid white;	box-shadow: 3px 3px 5px white;margin: 2px auto;border-radius: 10px;animation: frames 50s linear;
}
@keyframes frames{0% {background:  url("../images/run/freedom.png")  repeat; }20% {background:  url("../images/run/keep.png")  repeat; }40% {background:  url("../images/run/keep1.png")  repeat; }60% {background:  url("../images/run/Nike logo.png")  repeat; }80% {background:  url("../images/run/亚瑟士logo.png")  repeat; }100% {background:  url("../images/run/佳明logo.png")  repeat; }
}
.pbox{width: 450px;height: 250px;border:1px solid rgb(40 40 40);	float:left;margin-left: 5px;margin-top: 4px;border-radius: 10px;overflow: hidden;
}
.pbox:hover{transform: scale(1.1);border:2px solid white;border: 1px solid white;box-shadow: 0px 0px 5px white;
}
.ebox{width: 250px;height: 250px;border:1px solid white;	float:left;margin-left: 12px;margin-top: 4px;border-radius: 8px;
}.explain{width: 240px;height: 160px;border:1px solid #5151A2;	float:left;margin-left: 3px;margin-top: 4px;background-color: #5151A2;border-radius: 5px;font-size: 16px;line-height: 22px;text-align:left;
}
.explain:hover{transform: scale(1.1);border:2px solid white;color: white;box-shadow: 0px 0px 10px white;
}
.price{width: 240px;height: 65px;border:1px solid #5151A2;	float:left;margin-left: 3px;margin-top: 8px;background-color: #5151A2;border-radius: 5px;font-size: 22px;text-align-last: center;line-height: 65px;
}
.price:hover{transform: scale(1.1);border:2px solid white;box-shadow: 0px 0px 10px white;
}
.preic a:link{text-decoration: none;color:#686868;/*未访问时*/
}
a:visited{text-decoration: none;color:#808000;/*已访问*/
}
a:hover{font-size: 120%;text-decoration: underline;color:#03c;/*悬停*/text-decoration: box-shadow: 0px 0px 10px white;
}
.price a:active{text-decoration: none;color:#00FA9A;/*点击时刻*/
}

4.最后就是页脚footer的设置了,和nav的设置基本一样

页脚footer里面的图标,边框有透明以及圆角效果,鼠标悬浮放大的效果,以及旁边的阴影。

#footer{
width: 1500px;
height: 50px;
border: 1px solid white;
position:absolute;
top:2510px; 
background-color: #484891;
}#goback{width: 350px;height: 40px;text-align:center;font-size: 25px;border: 1px solid white;border-radius: 10px;margin-top: 5px;float: left;margin-right: 70px;}#goback:hover{transform: scale(1.1);box-shadow: 0px 0px 10px white;
}
#goback a{color: white;text-decoration: none;
}
#maker{width: 350px;height: 40px;color: 	#808000;text-align:center;font-size: 18px;border-radius: 10px;margin-top: 5px;float: left;margin-right: 70px;
}#service{width: 240px;height: 40px;color: white;text-align:center;font-size: 25px;border: 1px solid white;border-radius: 10px;margin-top: 5px;float: left;margin-right: 70px;
}
#service div{float:left;width: 40px;height: 30px;margin-right: 60px;margin-left: 20px;
}
#service:hover{transform: scale(1.1);box-shadow: 0px 0px 10px white;
}

值得注意的是这里设置了一个Go back to top返回顶部设置一个虚拟超链接#就能达到这个效果

<div id="goback"><a href="#">Go back to top</a></div>

最后小网页就基本完成啦,哈哈哈,虽然实现的功能很简单,很基础但是真的很有趣啊!
在这里插入图片描述
在这里插入图片描述
源码地址


http://chatgpt.dhexx.cn/article/UgwB3XKL.shtml

相关文章

游戏网页代码 html静态网页设计制作 dw静态网页成品模板素材网页 web前端网页设计与制作 div静态网页设计

&#x1f329;️ 精彩专栏推荐&#x1f447;&#x1f3fb;&#x1f447;&#x1f3fb;&#x1f447;&#x1f3fb; &#x1f482; 作者主页: 【进入主页—&#x1f680;获取更多源码】 &#x1f393; web前端期末大作业&#xff1a; 【&#x1f4da;HTML5网页期末作业 (1000套…

个人介绍网页代码 html静态网页设计制作 dw静态网页成品模板素材网页 web前端网页设计与制作 div静态网页设计

&#x1f389;精彩专栏推荐&#x1f447;&#x1f3fb;&#x1f447;&#x1f3fb;&#x1f447;&#x1f3fb; ✍️ 作者简介: 一个热爱把逻辑思维转变为代码的技术博主 &#x1f482; 作者主页: 【主页——&#x1f680;获取更多优质源码】 &#x1f393; web前端期末大作业…

一个简单的静态网页制作(html+css)

这是仿照中国高等教育学生信息网写的一个静态网页&#xff08;参考2020年3月份的&#xff09; 这也是我当时辛辛苦苦写了几天的劳动成果&#xff0c;希望大家可以尊重。 截图如下 下面是主要的代码&#xff1a; <!DOCTYPE html> <html> <head> <meta c…

html实战-制作静态网页

教程视频&#xff1a;http://edu.csdn.net/course/detail/535 从42开始 制作的网页&#xff1a;http://www.cnos.co/ 整体思路&#xff1a; 先布局再CSS控制 骨架搭好了&#xff0c;初始化样式&#xff0c; 后再弄CSS样式。注意&#xff1a;将CSS的样式导入到外部样式表时…

制作静态网页

首先进行CSS样式布局&#xff0c;根据样图进行块级标签分布&#xff0c;为每一个块级标签设置颜色以查看布局是否正确&#xff0c;最好是每设置一个块级标签颜色就查看一次是否排布正确&#xff0c;这样可以及时发现问题并解决问题&#xff1b;等到每一块区域都划分完成后&…

API幂等设计

API幂等就是在新增或更新数据时&#xff0c;如果多次发起同一个请求&#xff0c;只能产生一个结果。如&#xff1a;同一个订单多次提交&#xff0c;只能在数据库产生一个订单数据。我了解的基于redis实现幂等的有两种方式&#xff1a;基于token和基于请求。 基于token认证 参…

Mysql实现幂等_过幂等性问题

一、什么是幂等? 幂等性:多次调用方法或者接口不会改变业务状态,可以保证重复调用的结果和单次调用的结果一致。 二、使用幂等的场景 1、前端重复提交 用户注册,用户创建商品等操作,前端都会提交一些数据给后台服务,后台需要根据用户提交的数据在数据库中创建记录。如果用…

分布式锁实现业务幂等

1、前言 现如今很多系统都会基于分布式或微服务思想完成对系统的架构设计。那么在这一个系统中&#xff0c;就会存在若干个微服务&#xff0c;而且服务间也会产生相互通信调用。那么既然产生了服务调用&#xff0c;就必然会存在服务调用延迟或失败的问题。当出现这种问题&…

幂等性组件

根据上篇文章改进&#xff0c;并做成springbootstarter&#xff0c;依赖于redisson&#xff0c;如果redission已配置&#xff0c;则该组件可开箱即用 接口防重复提交_King_Kwin的博客-CSDN博客_接口防重复提交 本篇已做了较大的改动&#xff0c;可查看代码 idempotent: 幂等…

java幂等控制_JAVA幂等性实现

什么是幂等&#xff1a; 贴一张百度百科的图&#xff1a; 简单来说幂等保证了只要调用接口成功,外部多次调用对系统的影响是一致的&#xff0c;也就是一个请求多次重试的问题。 需要考虑幂等的场景&#xff1a; 客户端存在多次提交或者超时重试的情况&#xff1b; 分布式架构中…

幂等问题

点击↑上方↑蓝色“编了个程”关注我~ 每周至少一篇原创文章 这是本公众号的第 34 篇原创文章 最近比较懒&#xff0c;好几周没写文章了。还是没能坚持每周更新&#xff0c;愧对关注我的读者和自己的flag。。。 不过还好调整了过来&#xff0c;还是会继续坚持周更的。毕竟学习是…

常见的幂等性解决方案

背景 我们实际系统中有很多操作&#xff0c;是不管做多少次&#xff0c;都应该产生一样的效果或返回一样的结果。 get请求一般没有幂等性需求、delete请求一般也没有幂等性需求&#xff0c;post、update视情况而定例如&#xff1a; 前端重复提交选中的数据&#xff0c;应该后…

彻底理解接口幂等性

目录 背景 1. 幂等性的概念 2.什么情况需要处理接口幂等性问题&#xff1f; 2.1 select 天然自带幂等性。 2.2 insert 当我们重复插入数据的时候&#xff0c;会出现什么情况 &#xff1f; 2.3 delete 是否具有幂等性&#xff1f; 2.4 update 猜一猜是否具有天热幂等性&a…

【实战】聊聊幂等设计

前言 大家好,今天我们一起来聊聊幂等设计。 什么是幂等为什么需要幂等接口超时,如何处理呢?如何设计幂等?实现幂等的8种方案HTTP的幂等1. 什么是幂等? 幂等是一个数学与计算机科学概念。 在数学中,幂等用函数表达式就是:f(x) = f(f(x))。比如求绝对值的函数,就是幂等…

幂等性 详解

目录 一、幂等概念 1、幂等的数学概念 2. 幂等的业务概念 二、幂等概述 三、幂等场景 四、解决方案 1、token redis机制 2、乐观锁机制 3、唯一主键机制 4、去重表机制 5、门票机制 一、幂等概念 1、幂等的数学概念 如果在一元运算中&#xff0c;x 为某集合中的任…

幂等 (idempotence) 的概念

幂等 (idempotence) 的概念 幂等的数学概念 幂等是源于一种数学概念。其主要有两个定义 如果在一元运算中&#xff0c;x 为某集合中的任意数&#xff0c;如果满足 f(x) f(f(x)) &#xff0c;那么该 f 运算具有幂等性&#xff0c;比如绝对值运算 abs(a) abs(abs(a)) 就是幂…

偏度

偏度公式如下&#xff1a; 现在想解决如何从图像上解决为正为负的问题&#xff0c;如图所示&#xff1a; 个人理解&#xff1a;偏度中的偏是针对变量相对于中心点&#xff08;期望值&#xff09;距离的一种描述&#xff1b;如果厚尾的话&#xff0c;就说明有很多点距离中心点比…

偏度(skewness)

偏度 偏度&#xff08;skewness&#xff09;&#xff0c;是统计数据分布偏斜方向和程度的度量&#xff0c;是统计数据分布非对称程度的数字特征。定义上偏度是样本的三阶标准化矩。 偏度定义中包括正态分布&#xff08;偏度0&#xff09; 算术平均值 中位数 众数&#xff0c;…

策略梯度

Policy Gradient Methods for Reinforcement Learning with Function Approximation(PG) 在强化学习的算法中存在两种算法&#xff0c;一个是基于价值函数的算法&#xff0c;另一个是基于策略梯度的算法。为什么要提出策略梯度算法呢&#xff1f; 基于策略的学习可能会具有更好…

推荐系统中的偏差

推荐系统消偏 推荐系统中的偏差IPW ——逆概率加权DICE ——区分兴趣和偏差建模因果推断 推荐系统中的偏差 预估问题 我们一般会注重两种误差&#xff0c;偏差和方差&#xff0c; 方差与模型泛化能力有关&#xff1a;通常关注模型的复杂度与是否过拟合&#xff1b;偏差则表现为…