开始认认真真去学点东西主要是记录跟着B站去学在这就当做打卡吧3.28
<body>
<!-- 成对出现,文本内容不建议使用font标签 -->
<font color="red">欢迎来到这里由vscode开发</font>
<!--文本都放置于容器之中一般不会独立存在根据容器来调试 -->
<!-- 表格,div -->
<!-- style属性指定的是css样式 -->
<div style="color: orange ;font-size: 50px; font-family: 幼圆;">欢迎来到我的世界</div>
<!-- 图片 -->
<img src="image/shell脚本.png" width="200" /><br/>
<!-- 超链接 target打开新的标签页-->
<a href="https://www.baidu.com" target="_blank">百度练剑</a><br/>
<!-- 表格由行和列组成tr定义一行td定义一列 -->
<table width="500" height="200"bgcolor="red"border="2">
<tr>
<td width="40%" heigth="30">第一行第一列</td>
<td width="30%" height="30">第一行第二列</td>
<td width="30%" height="40">第一行第二列</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table>
<!-- 表单文本框 -->
<input type="text" placeholder="请输入你的用户名"/>
<!-- 密码框 -->
<input type="password"/>
<!-- 按钮 -->
<input type="button" value="请点击登陆"/>
<!-- 下拉框 -->
<select>
<option>选项一</option>
<!-- 默认被选中 -->
<option selected="">选项一</option>
<option>选项一</option>
</select>
<!--按钮补充 -->
<button>点我</button>
在这里插入代码片
<!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>计算器基于table实现</title>
<style>
/* 类选择器 */
.button{
background-color:gray;
/* 设置背景色 */
margin:auto;
/* 设置容器水平居中 */
}
/* 层次选择器 选择button 类下的所有标签为td的元素*/
.button tr td{
background-color: aquamarine;
width: 25%;
text-align: center;
font-size: 30;
}
.point-red{
width: 20px;
height: 20px;
background-color:red;
/* 水平 */
float:left;
/* 左右间隔 */
margin-left:10px;
border-radius: 50%;
}
.point-blue{
width: 20px;
height: 20px;
background-color:blue;
/* 水平 */
float:left;
/* 左右间隔 */
margin-left:10px;
border-radius: 50%;
}
.point-green{
width: 20px;
height: 20px;
background-color:green;
/* 水平 */
float:left;
/* 左右间隔 */
margin-left:10px;
border-radius: 50%;
}
.title{
color: blue;
font-size: 20px;
float:right;
margin-right: 20;
}
</style>
</head>
<body>
<!-- 表格两行一列 -->
<!-- 边框设置样式 -->
<!-- 水平居中 -->
<table width="450" height="120"bgcolor="gray" border="0" cellspacing="10" align="center">
<tr bgcolor="white" >
<td bgcolor="gray"height="50">
<div class="point-red"></div>
<div class="point-blue"></div>
<div class="point-green"></div>
<div class="title">计算器</div>
</td>
</tr>
<tr bgcolor="white" style="border: solid 2px red;">
<td></td>
</tr>
</table>
<!-- 五行四列 shift out-->
<table width="450" height="400" border="0"align="center" cellspacing="4" class="button">
<tr>
<td>AC</td>
<td>+/-</td>
<td>%</td>
<td>%</td>
</tr>
<tr>
<td>7</td>
<td>8</td>
<td>9</td>
<td>*</td>
</tr>
<tr>
<td>4</td>
<td>5</td>
<td>6</td>
<td>-</td>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>+</td>
</tr>
<tr>
<td>0</td>
<td>删除</td>
<td>.</td>
<td>=</td>
</tr>
</table>
</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>计算器div版</title>
</head>
<style>
#top{
width: 450px;
height: 50px;
margin: auto;
background-color:gray;
border-top-right-radius: 10px;
border-top-left-radius: 10px;
}
#top .point{
width: 20px;
height: 20px;
/* 水平 */
float:left;
margin-top: 15px;
/* 左右间隔 */
margin-left:10px;
border-radius: 50%;
}
#top .red{
background-color: red;
}
#top .blue{
background-color: blue;
}
#top .green{
background-color:green;
}
#title{
font-size: 22px;
margin-right: 15px;
float: right;
color: white;
margin-top: 15px;
}
#relust{
width: 446px;
height: 50px;
margin:auto;
background-color:white;
border:solid red;
}
#button{
width: 450px;
height: 422px;
background-color: gray;
margin: auto;
}
#button div{
width: 108px;
height: 80px;
float: left;
margin: 2px;
background-color: greenyellow;
line-height: 80px;
text-align: center;
font-size: 25px;
}
#button div:hover{
background-color: red;
font-size: 30px;
}
</style>
<body>
<!-- 顶部div -->
<div id="top">
<div class="point red"></div>
<div class="point blue"></div>
<div class="point green"></div>
<div id="title">小计算器</div>
</div>
<div id="relust"></div>
<div id="button">
<div>AC</div>
<div>+/-</div>
<div>%</div>
<div>%</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div>*</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>-</div>
<div>1</div>
<div>2</div>
<div>3</div>
<div>+</div>
<div>0</div>
<div>删除</div>
<div>.</div>
<div>=</div>
</div>
</body>
</html>
其实还有使用JS的方法去实现的可是捏不可以轻易放出来毕竟是跟着B站学的要是侵权请及时联系,来源是蜗牛学院嘿嘿嘿就当是给它宣传也是自己好好学习的一天,加油!