CSS常见样式的介绍和使用(附加案例)

article/2025/11/11 13:36:06

CSS样式

一、css介绍

层叠样式表(英文全称:Cascading Style Sheets)

​ 是一种用来表现HTML标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。CSS不仅可以静态地修饰网页,还可以配合各种脚本语言动态地对网页各元素进行格式化。

CSS 能够对网页中元素位置的排版进行像素级精确控制,支持几乎所有的字体字号样式,拥有对网页对象和模型样式编辑的能力

二、使用

2.1使用方式

css不可以单独使用 需要内嵌到HTML中

使用方式:

​ 方式一:行内样式:使用style属性,引入css样式 name id class style

​ 方式二:内联式 : style标签内部引入css样式

​ 方式三:外部样式

注意:

​ 推荐使用第三种

​ 就近原则:行内样式 > 内部样式和外部样式(谁离标签近 谁的优先级高

<!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><!--方式2: 内联式 : style标签内部引入css样式--><link rel="stylesheet" href="../css/demo.css"><style>h1{color: aqua;}p{color: blue;}</style><!--方式3:  外部样式--></head>
<body><!--方式一: 行内样式:使用style属性,引入css样式   name id class style--><!--优先级: 行内样式 >  外部样式-内联式(就近原则,谁离文本近谁有优先级最高)--><p style="color: chartreuse;">人间烟火气,最抚凡人心</p><p>窗前明月光,疑是地上霜</p><p>举头望明月,低头思故乡</p><h1 >本是天上逍遥的仙儿</h1>
</body>
</html>

2.2选择器

理解

​ 选择器定位到具体修饰的标签

选择器的种类:

1、标签选择器:根据标签名定位到具体的标签

2、id选择器: 根据id属性名定位到该标签【id有且唯一】

3、class选择器,根据class的值定位标签 *
class的值可以有多个:【多个标签可以有相同的class】【一个标签可以有多个class】

4、组合选择器:可以根据多种选择器类型匹配选择器定位标签【中间用逗号隔开】

5、层级选择器 : 由外到内一层一层的定位 【空格】

6、 *选择器

7、伪类选择器:通过 选择器:状态 定位标签

优先级: 层级选择器 > id选择器 > 其他选择器【就近原则】

案例

<!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>选择器</title>
</head>
<style>/* 1、标签选择器: 根据标签的名字定位到该标签 */p{font-size: larger;font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;color: deeppink;}/* 2、id选择器: 根据id属性名定位到该标签【id有且唯一】 */#p1{color: blue;}/* 3、class选择器,根据class的值定位标签 *//* class的值可以有多个:【多个标签可以有相同的class】【一个标签可以有多个class】 */.d1{font-size: x-large;color: aqua;}/* 4、组合选择器:可以根据多种选择器类型匹配选择器定位标签【中间用逗号隔开】  */#p1,.d1{color: gold;}/* 5、层级选择器 : 由外到内一层一层的定位 【空格】 */.d2 div span{font-size: small;color: blueviolet;}/* 6、 *选择器 :  */*{margin: 0px;}/* 7、伪类选择器:通过 选择器:状态 定位标签 *//* 未点击状态 */#a:link{font-size: x-large;color: rgb(236, 18, 164);}/* 点击后状态 */#a:visited{color: rgb(221, 41, 17);font-size: medium;}/* 鼠标悬停状态 */#a:hover{color: dimgrey;font-size: x-large;}/* 鼠标点击不松开状态 */#a:active{font-size: x-small;color: magenta;}/* 优先级: 层级选择器 > id选择器 > 其他选择器【就近原则】 */
</style>
<body><p>我落人中然自在,本是天上逍遥的仙儿~</p><p id="p1">哎呀我说生存呐~</p><div class="d1">哎呀我说命运呐~</div><p class="d1">玫瑰无原则 心动至上</p><div>我如果爱你,绝不像攀援的凌霄花</div><div class="d2"><div><span>内部标签</span></div></div><span>外部标签</span><hr><a id="a" href="https://www.baidu.com">点击跳转百度</a>
</body>
</html>

三、css的语法

格式:key:value; 键值对

样式名与样式值之间用冒号隔开

样式与样式之间用分号隔开

完整格式

​ 选择器{
​ 样式名:样式值;

​ 样式名:样式值;

​ ………………

​ }

四、常见样式

4.1尺寸修饰

<style>.d1{width: 20%;height: 500px;background-color: coral;font-size: 2em;/* em : 倍数 --相对与父窗口中的内容*/}
</style><body>尺寸修饰<div class="d1">div的内容</div>
</body>

在这里插入图片描述

4.2字体修饰

normal - 文字正常显示
italic - 文本以斜体显示
oblique - 文本为“倾斜”(倾斜与斜体非常相似,但支持较少)
font-weight 属性指定字体的粗细:

<style>.sp1{color: darkorange;font-size: 20px;font-weight: bolder;         /* bolder 字体是否加粗*/font-style: italic;          /* italic 字体是否倾斜*/font-family: "宋体";         /* 设置字体样式*/}.sp2{/* 简写 *//* 顺序不能能变:style-weigth-size-family */font:italic bolder  15px 宋体 ; color:rgb(28, 235, 97);}
</style>
<body><span class="sp1">我是个沉默不语的,靠着车窗想念你的乘客</span><br><span class="sp2">当107路再次经过</span><p>当107路再次经过</p>
</body>

在这里插入图片描述

4.3文本修饰

color: 字体颜色
text-align: center; - - 文本对齐方式
text-decoration:none; - - 文本的线
text-shadow: pink 5px 5px 2px; - - 文本的阴影 【阴影颜色-水平方向的偏移量-垂直方向的偏移量-模糊距离】
line-height: - - 行高 (文本在标签内所占的高度)
width:
height:
border: 1px #ffffff solid; - - 盒子边框【边框粗细-颜色-边框线样式】

<style>.p{color: rgb(0, 255, 21);                 /* 字体颜色 */text-align: center;                       /* 文本对齐方式 */text-decoration:none;                     /* 文本的线 */text-shadow: pink 5px 5px 2px;          /* 文本的阴影 【阴影颜色-水平方向的偏移量-垂直方向的偏移量-模糊距离】*/line-height: 400px;                       /* 行高 (文本在标签内所占的高度)*/width: 400px;height: 300px;border: 1px rgb(76, 14, 223) solid;     /* 盒子边框【边框粗细-颜色-边框线样式】 */}</style>
</head><body><p class="p">我不是你的先生宋东野</p><a href="https://www.baidu.com"></a>
</body>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-4IWqIRPk-1647871288781)(C:\Users\12994\Desktop\笔记整理\JavaWeb\笔记\总结整理\CSS样式.assets\image-20220321213356486.png)]

4.4背景修饰

width: 500px;
height: 1200px;
background-color: pink; - - 背景颜色
background-image: url(…/img/background.jpg); - - 背景图片
background-repeat: no-repeat; - - 背景图片是否平铺
background-position: left top; - - 指定背景图片的位置
background-attachment: fixed; - - 背景图片是否随着标签滚动 【fixed-固定 scroll-滚动】

   <style>.d{width: 500px;height: 1200px;background-color: pink;                                   /* 背景颜色  */background-image: url(../img/background.jpg);               /* 背景图片  */background-repeat: no-repeat;                               /* 背景图片是否平铺  */background-position: left top;                              /* 指定背景图片的位置  */background-attachment: fixed;                               /* 背景图片是否随着标签滚动 【fixed-固定  scroll-滚动】 */}</style>
</head>
<body><div class="d"></div>

在这里插入图片描述

4.5定位修饰

relative- -相对定位 相对变迁原先的位置为起点 【通过top left right bottom 来调整 】

absolute- -绝对定位 以页面的左上为起点 【通过top left right bottom 来调整 】

fixed- -固定定位 【位置不会变化】

 <style>.d1{width: 100px;height: 100px;background-color: aqua;}.d2{width: 150px;height: 150px;background-color:red;position: relative;             /* 位置【  absolute-绝对定位  fixed-固定定位】*/top: 50px;left: 50px;/* relative-相对定位  相对变迁原先的位置为起点 通过top left right bottom 来调整 *//* absolute-绝对定位  以页面的左上为起点 通过top left right bottom 来调整 *//* fixed-固定定位 位置不会变化*/}</style>
</head>
<body><div class="d1"></div><div class="d2"></div>
</body>

在这里插入图片描述

4.6浮动

float :left | right

特点:

​ 1、一经读懂脱离文档流

​ 2、标签将不再独占一行

​ 3、顶部对齐

注意:

​ 浮动会影响后面的标签布局,因此使用了浮动之后需要清除浮动
清除浮动
div style=“clear: both;”></div

 <style>.d1{width: 100px;height: 100px;background-color: aqua;float: right;}.d2{width: 50px;height: 50px;background-color: rgb(115, 255, 0);float: left;                    /* 浮动 【会影响页面布局,需要清除标签】 */}.d3{width: 150px;height: 150px;background-color: rgb(255, 0, 242);float: left;}</style>
</head>
<body><div class="d1"></div><div class="d2"></div><div class="d3"></div><!-- 清除浮动 --><div style="clear: both;"></div>
> 概述:是一个双列集合,属于map集合的实现类。
* 集合中的key值是唯一的,元素是无序的
* HashMap集合去重原理和无序原理和HashSet集合原理一致
* 通过比较key的哈希值和equals的结果来实现去重
* HashSet集合底层就是使用HashMap来实现的
### LinkedHashMap集合概述:是一个双列集合,是HashMap集合的子类
**特点:** 本类没有特殊的方法,只能使用父类中继承的 集合中元素有序 集合中的key值唯一
### 【笔试题】HashMap集合和HashTable集合的区别相同点:**两个集合都是Map接口的实现类,都属于双列集合
两个集合底层是使用哈希表来存储数据
* 两个集合中的方法大致相同
**不同点:** 版本不同:HashMap是jdk1.2出现的,HashTable是jdk1.0出现
* 线程安全性不同:HashMap是线程不安全的,HashTable线程安全的
* 存储的值不同:HashMap可以存储null键null值,HashTable不可以存储null
</body>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-ywj72qxG-1647871288784)(C:\Users\12994\Desktop\笔记整理\JavaWeb\笔记\总结整理\CSS样式.assets\image-20220321214316996.png)]

4.7display

特点:

​ 1、可以实现底部对齐

​ 2、可以实现块标签、行标签以及行内块的转换

​ 3、隐藏标签

块标签:独占一行 可以设置宽高

行标签:不独占一行 不可以设置宽高

行内块:不独占一行 可以设置宽高

<style>.d1{width: 100px;height: 100px;background-color: aqua;display: inline-block;  /* 转为行内块  :可以设置宽高、但不独占一行 */}.d2{width: 50px;height: 50px;background-color: rgb(115, 255, 0); display: inline-block;  /* 转为行内块 */                  }.d3{width: 150px;height: 150px;background-color: rgb(255, 0, 242);display: inline-block;  /* 转为行内块 */}.sp1{display: inline-block;width: 50px;height: 50px;background-color: coral;}.sp2{display: block;width: 50px;height: 50px;background-color: rgb(2, 62, 228);}h2{display: none;    /* 隐藏标签 */}</style>
</head>
<body><h2>display的使用</h2><div class="d1"></div><div class="d2"></div><div class="d3"></div><span class="sp1">span1内容</span><span class="sp2">span2内容</span>body
</body>

在这里插入图片描述

4.8盒子模型

为页面提供了一种思路

边框: border

内边距:padding—-盒子中的内容与盒子边框的距离

外边距:margin——盒子中的内容与盒子边框的距离

注意:

​ 盒子总大小 : width / height + 边框×2 + margin×2 + padding×2

 <style>.d1{width:100%;height:30px;background-color: #e3e4e5;}.d2{width: 100%;height: 140px;background-color: #ffffff;}.d3{width: 100%;height: 1000px;background-color: #f4f4f4;}</style>
</head>
<body><div class="d1"></div><div class="d2"></div><div class="d3"></div>
</body>

在这里插入图片描述

案例

案例一、京东头部

<!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>
</head>
<style>*{margin: 0px;padding: auto;}.dd{width: 100%;height: 40px;background-color: #e3e4e5;}ul{/* 去除ul列表前的圆点 */list-style-type: none;margin-left: 700px;font-size: 12px;color: #999999;}ul li{float: left;/* li标签间隔 */margin-left: 15px;/* 垂直方向居中 */line-height: 40px;}
</style>
<body><div class="dd"><ul><li>您好,请登录</li><li>|</li><li>我的订单</li><li>|</li><li>我的京东</li><li>|</li><li>京东会员</li><li>|</li><li>企业采购</li><li>|</li><li>客户服务</li><li>|</li></ul></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>*{margin: 0px;padding: auto;}.header{/* border: 1px solid black; */width: 100%;height: 80px;}.header img{float: left;margin-left: 465px;margin-top: 8px;}.header font{font-size: 24px;line-height: 80px;color: #484e53;float: left;margin-top: 5px;margin-left: 24px;}.dd img{margin-top: 12px;position: absolute;line-height: 40px;margin-left:490px ;}.dd p{/* float: left; */margin-left:510px ;line-height: 40px;}.dd{position: absolute;width: 100%;height: 40px;background-color: antiquewhite;           }.body{/* border: 1px solid rgb(11, 220, 235); */width: 100%;height: 475px;background-color: #8ABFE9;background-repeat: no-repeat;background-size: 100% 100%;/* background-image: url(img/body.jpg); */margin-top: 40px;}.login{/* border: 1px solid rgb(11, 220, 235); */position: absolute;width: 347px;height: 370px;background-color: #ffffff;margin-left: 1108px;margin-top:-440px;position: absolute;float: left;}.body .login p font {position: absolute;color: #b5b5b6;margin-left: 50px;margin-top: 30px;font-size:large;}.body .login p font1{position: absolute;font-size:large;color: #fa0909;margin-top: 30px;margin-left: 222px;margin-bottom: 5px;}.body .login font2{position: absolute;margin-top: 63px;color: #b5b5b6;font-size: small;}.body .login p .um{width: 40px;height: 40px;border: 1px solid #c3c3c3;background-image: url(img/ren.jpg);background-size: 100% 100%;float: left;margin-top: 19px;margin-left: 20px;}.body .login p input{width: 266px;height: 38px ;float: left;border: none;margin-top: 19px;border: 1px solid #c3c3c3;}.body .login p1 .sm{width: 40px;height: 40px;border: 1px solid #c3c3c3;background-image: url(img/锁.jpg);background-size: 100% 100%;float: left;margin-top: 12px;margin-left: 20px;}.body .login p1 input{width: 266px;height: 38px ;float: left;border: none;margin-top: 12px;border: 1px solid #c3c3c3;}#pp{position: absolute;margin-top: 200px;}#button{position: absolute;float: left;width: 314px;height: 40px;background-color: #df0a17;margin-top: 160px;margin-left: -314px;text-align: center;font-size:x-large;line-height: 40px;color: #ffffff;text-decoration: none;}#forget{position: absolute;color: rgb(63, 62, 62);margin-top: 130px;margin-left: -50px;}#login-footer{width: 347px;height: 50px;background-color: #f3ecec88;margin-left: 1108px;margin-top:-120px;position: absolute;float: left;}#qq{position: absolute;margin-top: 20px;margin-left: 20px;}#wei{position: absolute;margin-top: 20px;margin-left: 90px;}#reg{position: absolute;margin-top: 20px;margin-left: 250px;}.QQ{position: absolute;color: rgb(63, 62, 62);margin-top: 18px;margin-left: 43px; }.weixin{position: absolute;color: rgb(63, 62, 62);margin-top: 18px;margin-left: 113px; }.REG{position: absolute;color: rgb(63, 62, 62);margin-top: 18px;margin-left: 273px; }.footer{width: 100%;height: 40px;background-color: #FFFFFF;}ul{/* 去除ul列表前的圆点 */list-style-type: none;margin-left: 480px;font-size: 12px;color: #999999;}ul li{float: left;/* li标签间隔 */margin-left: 13px;/* 垂直方向居中 */line-height: 40px;}#footword{position: absolute;color: #999999; font-size: 12px;margin-top: 40px;margin-left: 830px;}#tip{position: absolute;margin-top: 50px;margin-left: 1108px;z-index: 99;background-color: antiquewhite;text-align: center;font-size: small;line-height: 40px;color: #858282;width: 347px;height: 40px;}#chat{margin-top: 55px;}#page{position: absolute;color: rgb(109, 107, 107);font-size: small;margin-left: 610px;margin-top: 20px;}#img{z-index: -1;margin-left: 470px;font-size: 100% 100%;}</style>
</head>
<body><div class="header"><img src="https://misc.360buyimg.com/lib/img/e/logo-201305-b.png" ><font id="page">登录页面,调查问卷</font><font>欢迎登录</font><img id="chat" src="https://misc.360buyimg.com/user/passport/1.0.0/css/i/q-icon.png"></div><div id="tip"><img src="https://misc.360buyimg.com/user/passport/1.0.0/widget/login-form-2018-0827/i/icon-tips.png"><font>京东不会以任何理由要求您转账汇款,谨防诈骗。</font></div><div class="dd"><img src="https://misc.360buyimg.com/user/passport/1.0.0/widget/login-form-2018-0827/i/icon-tips.png" ><p style="color: #858282; font-size:x-small; ">依据《网络安全法》,为保障您的账户安全和正常使用,请尽快完成手机号验证! 新版《京东隐私政策》已上线,将更有利于保护您的个人隐私。</p></div><div class="body"><img id="img" src="img/body.jpg" alt=""><div class="login"><p><font>扫码登陆</font><font1>账户登录</font1></p><font2>——————————————————————————</font><p><span class="um"></span><input type="text" name="username" placeholder="邮箱/用户名/手机号"></p><p1><span class="sm"></span><input type="password" name="username" placeholder="请输入密码"></p><!-- <span >登&nbsp;&nbsp;录</span> --><a id="button" href="https://www.baidu.com/">&nbsp;&nbsp;</a><span id="forget" ">忘记密码</span>         </div><div id="login-footer"><p id="qq"><img src="img/QQ.jpg" ></p><font class="QQ">QQ</font><p1 id="wei"><img src="img/WEchart.jpg"></p1><font class="weixin">微信</font><p2 id="reg"><img src="img/注册.jpg" ></p2><font class="REG">立即注册</font></div>       </div><div class="footer"><ul><li>关系我们</li><li>|</li><li>联系我们</li><li>|</li><li>人才招聘</li><li>|</li><li>商家入驻</li><li>|</li><li>广告服务</li><li>|</li><li>手机京东</li><li>|</li><li>友情链接</li><li>|</li><li>销售联盟</li><li>|</li><li>京东社区</li><li>|</li><li>京东公益</li><li>|</li><li>English Site</li><li>|</li></ul><div id="footword">Copyright © 2004-2022  京东JD.com 版权所有</div></div>
</body>
</html>

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-uElRu829-1647871288788)(C:\Users\12994\Desktop\笔记整理\JavaWeb\笔记\总结整理\CSS样式.assets\image-20220321215455055.png)]

        </p2><font class="REG">立即注册</font></div>       
</div><div class="footer"><ul><li>关系我们</li><li>|</li><li>联系我们</li><li>|</li><li>人才招聘</li><li>|</li><li>商家入驻</li><li>|</li><li>广告服务</li><li>|</li><li>手机京东</li><li>|</li><li>友情链接</li><li>|</li><li>销售联盟</li><li>|</li><li>京东社区</li><li>|</li><li>京东公益</li><li>|</li><li>English Site</li><li>|</li></ul><div id="footword">Copyright © 2004-2022  京东JD.com 版权所有</div>
</div>
```

在这里插入图片描述


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

相关文章

CSS 示例

基础内容 引入样式表&#xff1a;<link rel"stylesheet" href"test.css"> em&#xff1a;相对大小单位 选择器 示例说明#id选择所有类.clsss选择所有类p选择所有p标签&#xff0c;可以加逗号分组p em后代选择器&#xff0c;选中p标签中所有em标签…

CSS-200个小案例(一)

最近我在youtube上跟着大神学习200个CSS小案例&#xff0c;作者Online Tutorials 编码的内容很实用&#xff0c;案例中涉及定位、变换、动画等概念&#xff0c;适合进一步学习和巩固CSS知识&#xff0c;能帮助我们实现页面的特效。 youtube视频链接&#xff1a;https://www.you…

30个超棒的CSS应用实例

这 篇文章是很早之前在博客园看到的&#xff0c;收藏在网摘里&#xff0c;今天再看发现实在很棒&#xff0c;转载过来方便以后参考用&#xff0c;最棒的地方是这些效果的实现都只是利用CSSHTML 来实现的&#xff0c;基本上没有用到什么FLASH或JS脚本&#xff0c;大家也可以看看…

【CSS实例】

学习目标&#xff1a; css样式学习、总结&#xff0c;知识巩固 学习内容&#xff1a; 在这里我将会发布一些自己学习过程中完成的css实例&#xff0c;可能是跟着网上学习的练习作品&#xff0c;也可能是自己的随意的一个想法。每个作品中会列出编写思路&#xff0c;和编写过程…

codewar代码练习1——8级晋升7级

最近发现一个不错的代码练习网站codewar&#xff08;http://www.codewars.com&#xff09;。注册了一个账号&#xff0c;花了几天的茶余饭后时间做题&#xff0c;把等级从8级升到了7级。本文的目的主要介绍使用感受及相应题目&#xff0c;可供大家参考。 新人注册为8级&#xf…

codewar python 遗忘点

2019独角兽企业重金招聘Python工程师标准>>> 1、计算字符串中特定字符串出现的次数 s this is a new technology,and I want to learn this. print(s.count(this, 0, len(s))) #目标字符串区分大小写 2、数字左边补0的方法,字符串补空格 #python中有一个zfil…

Codewar - Bit Counting

2019独角兽企业重金招聘Python工程师标准>>> Write a function that takes an (unsigned) integer as input, and returns the number of bits that are equal to one in the binary representation of that number. Example: The binary representation of 1234 is…

codewar 代码练习1——8级晋升7级

最近发现一个不错的代码练习网站codewar&#xff08;http://www.codewars.com&#xff09;。注册了一个账号&#xff0c;花了几天的茶余饭后时间做题&#xff0c;把等级从8级升到了7级。本文的目的主要介绍使用感受及相应题目&#xff0c;可供大家参考。 新人注册为8级&#xf…

codewar 代码练习2——7级晋升6级

7级晋升到6级的过程中以做6级题以及以前未完成的题目为主&#xff0c;一般选择算法题或者基础题。相比之前从8级升级7级&#xff08;参见此博客&#xff1a;http://blog.csdn.net/m0_37324740/article/details/78408249&#xff09;的难度有所提前&#xff0c;并且一些题目结合…

R数据分析,codewar的年终总结,和一周年总结

前阵子单位各个部门都在要求弄总结&#xff0c;想想自己这个公众号也写了快一年了&#xff0c;专门回去翻了翻&#xff0c;这个公众号发布的第一篇文章是在2021年的1月17日&#xff0c;我想2022年的1月17日我就把现在敲的文字推出来吧&#xff0c;也算是一个年终和周年总结。 …

CodeWar题目

打算把不同网站上面的题目分开整理&#xff0c;免得麻烦。Code War上面我还是刷了一堆6级及以下的题目的&#xff0c;不过价值不大&#xff0c;这种不太能够训练实际解决问题的能力&#xff0c;所以我已经很久没上过了&#xff0c;有时间了可能会重新上去刷题吧&#xff0c;到时…

Codewar 笔记

1. Weight for weight 题目&#xff1a; For example 99 will have “weight” 18, 100 will have “weight” 1 so in the list 100 will come before 99. Given a string with the weights of FFC members in normal order can you give this string ordered by “weights”…

codewar刷题,苦海造舟之始

今天又是被惨虐的一天&#xff0c;尽管今天是我这篇处女座发布的日子。   事情是这样的&#xff0c;身为一个刚迈步进入编程领域的小白&#xff0c;在无忧无虑&#xff0c;轻松惬意的心情下刷完了一套python课后&#xff0c;偶然间&#xff0c;很突然地了解到codewars这么个玩…

Codewar一些积累No.2 从矩阵的加法体会vector的用法

用代码实现矩阵加法问题 最近在Codewar上看到一个有趣的问题是关于矩阵的加法问题. 题目中, 我所要编写的函数的传入参数是两个向量, 而且此向量是嵌套的, 具体内容如下: std::vector<std::vector<int> > matrixAddition(std::vector<std::vector<int> …

Java到底好不好学

Java到底好不好学 答案是&#xff1a;不难学。很多人都以为编程是个很高深的东西&#xff0c;其实不然&#xff0c;真正学习了你会发现编程比你高中学的数理化要简单的多。说它不难呢&#xff0c;如果学深入了&#xff0c;还算有很多东西要学习&#xff0c;比如你学Java&#…

java面试为何那么难

java面试为何那么难 “面试造火箭、工作拧螺丝”&#xff0c;曾经这么一句调侃的话总是用来形容IT行业中的面试情况。作为一个流浪的程序猿&#xff0c;多年以来作为应聘者也好、面试官也罢&#xff0c;渐渐感受到java开发的面试不再仅仅在“造火箭”那么容易。 我的就职历程…

java面试为何那么难?

“面试造火箭、工作拧螺丝”&#xff0c;曾经这么一句调侃的话总是用来形容IT行业中的面试情况。作为一个流浪的程序猿&#xff0c;多年以来作为应聘者也好、面试官也罢&#xff0c;渐渐感受到java开发的面试不再仅仅在“造火箭”那么容易。 五年前的java面试是怎么样的 用HT…

女生学java开发难吗?女生适合学java吗?

女生学java开发&#xff1f;Java开发看上去是一项系统性很强、入门很难的“高大上”学科&#xff0c;前端、代码这些普通人基本不会接触到的名词&#xff0c;吓怕了众多初学者。大部分人对于Java程序员都有一个既定印象&#xff0c;那就是程序员都是男生。女程序员可以说是“稀…

自学java难吗?给java初学者的一些建议。

自学java到底难不难&#xff1f; 其实学习java说难不难&#xff0c;说简单也不简单。如今互联网十分发达&#xff0c;各种学习资料&#xff0c;视频&#xff0c;文档都可以在网上找到。可以说如今是一个全民自学的时代&#xff0c;你要你有决心和时间&#xff0c;足不出户便能…

java编程难学吗?

java是一门面向对象编程语言&#xff0c;不仅吸收了C语言的各种优点&#xff0c;还摒弃了C里难以理解的多继承、指针等概念&#xff0c;因此Java语言具有功能强大和简单易用两个特征。Java语言作为静态面向对象编程语言的代表&#xff0c;极好地实现了面向对象理论&#xff0c;…