c1能力认证-任务03-web基础与布局

本文介绍了如何使用开源富文本编辑器Summernote,并展示了如何将文本转换为HTML标签。同时,通过实例演示了如何实现表格隔行换色和JavaScript按钮功能。接着,以WYSIWYG方式在code.org上进行HTML和CSS的网页开发任务,深化了对这两种技术的理解。此外,详细探讨了CSS盒子模型,包括边距、边框和内边距,以及浮动和定位的概念。最后,给出了一个CSS盒子模型布局的实现,并提供了HTML5和CSS的相关技术问题供读者自测。

任务一:使用富文本编辑器
首先,在开源富文本编辑器(https://summernote.org/)中随便输入一段文本。
然后,在源码模式下,查看内容是如何被转变为带标签的文本的,都带了哪些HTML标签。
最后,实现编辑器没有的功能,例如让表格隔行换色,加入JavaScript按钮,试着完成它。

任务二:“所见即所得”式开发
在code.org上一“所见即所得(WYSIWYG)”的方式完成HTML和CSS系列网页开发任务(https://studio.code.org/s/csd2-2019)
如果已注册账号则无需再注册。
加深对HTML和CSS技术的理解。

拓展:CSS盒子模型
深入理解CSS盒子模型多层次含义
边框边距
标准文档流(浮动与定位)
布局模式
完成下图的CSS盒子模型布局

自测:

  • HTML5为了使img元素可拖放,需要增加什么属性?
  • HTML5哪一个input类型可以选择一个无时区的日期选择器?
  • CSS盒子模型中的Margin、Border、Padding都是什么意思?
  • 说出至少五种常见HTML事件
  • HTML的onblur和onfocus是哪种类型的属性?
  • 怎么设置display属性的值使容器成为弹性容器?
  • JavaScript中有多少中不同类型的循环?
  • 用户搜索某个单词后,JavaScript高亮显示搜索到的单词,使用哪个语义化标签最合适?

分割线开始任务

任务一:
如图所示:表格隔行换色,js按钮效果如下。
在这里插入图片描述
代码如下:

	<p align="center">北上广天气预报</p>
	<table border="5" width="500px" bgcolor="skyblue" cellspacing="0" cellpadding="20px" align="center" frame="void">
				<caption>标题:3月平均气温</caption>  
				<thead>  
					<tr align="center" valign="center" bgcolor="steelblue">
                      <th height="40"><span align="center" valign="center">城市</span></th>  <!-- 加粗和居中 -->
                      <td align="center">北京</td>
                      <td align="center">上海</td>
					  <td align="center">广州</td> 
					</tr>
				</thead>
				<tbody>
					<tr align="center">
						<td>温度</td>
						<td>26</td>
						<td>25</td>
						<td>30</td>
					</tr>
					<tr align="center" bgcolor="steelblue">
						<td>紫外线</td> 
						<td></td>  
						<td></td>
						<td></td>
					</tr>
					<tr align="center">
						<td>天气</td>
						<td>多云</td>
						<td>多云</td>
						<td>晴天</td>
					</tr>
				</tbody>
				<tfoot>
					<tr align="center" bgcolor="steelblue">
						<td>风力</td>
						<td>3</td>
						<td>4</td>
						<td>1</td>
					</tr>
				</tfoot>
			</table>&nbsp;<p></p><p><br></p>
<button border="1" cellpadding="1" onclick="alert('开始考试')">我要考试</button>

任务二:“所见即所得”式开发
https://studio.code.org/s/csd2-2019
在这里插入图片描述
在这里插入图片描述

拓展任务:CSS盒子模型
深入理解CSS盒子模型多层次含义
边框边距
标准文档流(浮动与定位)
布局模式
完成下图的CSS盒子模型布局
在这里插入图片描述
代码如下:
采用table的方式布局(主体部分如下:table123456)

<!DOCTYPE html>
<html>
<head>
<style>
	* {
	  margin: 0;
	  padding: 0;
	}
	table{width: 100%;height: 100%;}
	.table0{
		border: solid;
		border-width: 5px;
		border-color: #838383;
		background-color:#dfdf6f ;
		max-width: 500px;
		max-height: 400px;
	}
	.table1{
		width: 100%;
		border-style: none;
		line-height: 80px;
		border-spacing: 10px 10px;
	}
	.table2{
		width: 100%;
		border-style: none;
		border-spacing: 0px 10px;
		padding-right: 10px;
	}
	#block1{
		background-color: #81ec8d;
		height: 100%;
		text-align: center;
	}
	#block2{
		background-color: #81ec8d;
		height: 200px;
		text-align: center;
	}
	#block3{
		background-color: #81ec8d;
		height: 150px;
		text-align: center; 
		
	}
	#block4{
		background-color: #81ec8d;
		height: 150px;
		text-align: center; 
	}
</style>
</head>
<body>
	<table class="table0">
		<tr>
			<td>
				<table class="table1">
					<tr id="block1"><td>1</td></tr>
					<tr id="block2"><td>2</td></tr>
				</table>
			</td>
			<td>
				<table class="table2">
						<tr id="block3"><td>3</td></tr>
						<tr>
							<td>
								<table >
									<tr>
										<td id="block4">4</td>
										<td>
											<table >
												<tr><td>5</td></tr>
												<tr><td>6</td></tr>
											</table>
										</td>
									</tr>
								</table>
							</td>
						</tr>
				</table>
			</td>
		</tr>
	</table>
</body>
</html>

采用table的方式布局
继续完善block789

<!DOCTYPE html>
<html>
<head>
<style>
	* {
	  margin: 0px;
	  padding: 0px;
	}
	#block9{
		background-color: #ffaa7f;
		position: absolute;
		width:35px;
		padding: 30px;
		text-align: center;
		left: 120px;
		top: 340px;
	}
	table{width: 100%;height: 100%;}
	.table0{
		border: solid;
		border-width: 5px;
		border-color: #838383;
		background-color:#dfdf6f ;
		max-width:600px;
		box-sizing: border-box;
	}
	.table1{
		width: 100%;
		border-style: none;
		line-height: 100px;
		border-spacing: 10px 10px;
	}
	.table2{
		width: 100%;
		border-style: none;
		border-spacing: 0px 10px;
		padding-right: 10px;
	}
	#block1{
		background-color: #81ec8d;
		height: 100px;
		text-align: center;
	}
	#block2{
		background-color: #81ec8d;
		height: 190px;
		text-align: center;
	}
	#block3{
		box-sizing: border-box;
		background-color: #81ec8d;
		height: 180px;
		text-align: center; 
	}
	#block4{
		background-color: #81ec8d;
		height: 100px;
		text-align: center; 
		position: relative;
		z-index:10000;
	}
	#block5{
		background-color: #81ec8d;
		text-align: center; 
		height: 80px;
	}
	#block6{
		background-color: #81ec8d;
		text-align: center; 
		height: 80px;
	}
	.table4{
		padding-left: 10px;
		border-spacing: 0px 10px;
		margin-top: -10px;
		margin-bottom: -10px;
	}
	#block7{
		background-color: #ffaa7f;
		position: relative;
		margin-left: 10px;
		width: 30px;
		padding: 40px;
	}
	#block_3{
		position: relative;
		text-align: center;
		top: -60px;
	}
	#block8{
		margin: -20px;
		background-color: #ffaa7f;
		position: absolute;
		width:15px;
		padding: 50px;
		height: 10px;
		box-sizing: border-box;
		left: 400px;
		top: -20px;
		text-align: center;
	}
</style>
</head>
<body>
	<div >
		<table class="table0">
			<tr>
				<td>
					<table class="table1">
						<tr id="block1"><td>1</td></tr>
						<tr id="block2"><td>2</td></tr>
					</table>
				</td>
				<td>
					<table class="table2">
							<tr id="block3"><td><div id="block7">7</div><div id="block_3" >
								3
							</div><div id="block8">8</div></td></tr>
							<tr>
								<td>
									<table class="table3">
										<tr>
											<td id="block4" >4 </td>
											<td>
												<table class="table4">
													<tr id="block5" ><td>5</td></tr>
													<tr id="block6"><td>6</td></tr>
												</table>
											</td>
										</tr>
									</table>
								</td>
							</tr>
					</table>
				</td>
			</tr>
		</table>
	</div>
	<div id="block9">
		9
	</div>
</body>
</html>

自测:
1.HTML5为了使img元素可拖放,需要增加什么属性?

答:<img draggable="true">

2.HTML5哪一个input类型可以选择一个无时区的日期选择器?

答: <input type="date">

3.CSS盒子模型中的margin,border,padding都是什么意思?

答:外边距(margin)、边框(border)、内边距(padding)

4.说出5种常见的HTML事件

答:Window 事件属性,表单事件,键盘事件,鼠标事件,媒介事件

5.HTML的onblur和onfocus是哪种类型的属性?

答:onblur失去焦点事件 onfocus 获得焦点事件

6.怎么设置display属性值使容器成为弹性容器?

答:flex

7.Javascript种有多少种不同类型的循环?

答:for循环;do..while循环;while循环

8.用户搜索某个单词后,JavaScript高亮显示搜索到的单词,使用哪个语义化标签最适合?

答:<mark>
内容概要:本研究聚焦于“绿电直连型电氢氨园区”的优化运行,提出一种直接利用绿色电力驱动制氢合成氨的综合能源系统架构。通过构建包含风/光发电、电解水制氢、氢气储存、合成氨反应及电能直供等关键环节的系统模型,研究旨在实现能源的高效转化梯级利用,降低对外部电网依赖,提升园区能源自洽率经济性。研究综合运用MatlabPython工具进行建模仿真,结合实际气象负荷数据,对系统在不同工况下的运行策略、能量流动、设备容量配置及经济技术指标进行深入分析优化,并形成完整的Word论文文档,为新型零碳产业园区的规划建设提供了理论依据和技术支撑。; 适合人群:具备新能源、电力系统、化工或综合能源系统背景的科研人员,以及从事园区规划、能源管理、低碳技术开发的工程技术人员。; 使用场景及目标:①研究绿电如何高效耦合至化工生产流程,实现“电--氨”多能互补;②掌握综合能源系统(IES)的建模、仿真优化方法,特别是多时间尺度下的运行调度策略;③为撰写高水平学术论文或完成相关课题研究积累数据、代码写作模板。; 阅读建议:此资源包含代码、数据和完整论文,建议使用者先通读Word论文以理解整体框架理论基础,再结合Matlab/Python代码进行复现调试,最后可基于提供的数据和模型进行二次开发,以深化对绿电综合利用技术的理解。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Friedy星期五

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值