学习目标:
一、使用富文本编辑器
二、所见所得 式开发
三、扩展css盒子模型
四、自测
学习内容:
一、使用富文本编辑器
1.首先我们打开网址( https://summernote.org/),在富文本编辑器下写入一段文本,
然后,在源码模式下,查看内容是如何转变为带标签的文本的,都带了那些HTML标签
最后,实现编辑器没有的功能,例如让表格显示颜色,加入JavaScript按钮,试着完成它吧
代码:
<h4><meta charset="UTF-8">
</h4>
<table width="60%" cellpadding="2" border="1" bgcolor="#FF0F00">
<caption><font color="#00FFFF">课程表</font></caption>
<style>
table{
margin:5px auto;
width:60%;
padding:5px;
}
th{
background-color:#76B7BC;
font-size:14px;
padding:5px;
}
.even td{/*必须加td,代表的是一行进行*/
background-color:#BCD7DA;
padding:5px 6px;
}
.odd td{
background-color:#FFF;;
padding:5px 6px;}
</style>
<tbody><tr align="center">
<td colspan="2">时间\日期</td>
<td>一</td>
<td>二</td>
<td>三</td>
<td>四</td>
<td>五</td>
</tr>
<tr class="even" begcolor="#FF00FF" align="center">
<td rowspan="2">上午</td>
<td>9:30-10:15</td>
<td>语文</td>
<td>语文</td>
<td>语文</td>
<td>语文</td>
<td>语文</td>
</tr>
<tr class="even " begcolor="#FF0000" align="center">
<td>10:25-11:10</td>
<td>语文</td>
<td>语文</td>
<td>语文</td>
<td>语文</td>
<td>语文</td>
</tr>
<tr>
<td colspan="7"> </td>
</tr>
<tr align="center">
<td rowspan="2">下午</td>
<td>14:30-15:15</td>
<td>语文</td>
<td>语文</td>
<td>语文</td>
<td>语文</td>
<td>语文</td>
</tr>
<tr background="#F0F0F0" align="center">
<td>15:25-16:10</td>
<td>语文</td>
<td>语文</td>
<td>语文</td>
<td>语文</td>
<td>语文</td>
</tr>
</tbody></table>
<input type="button" value="提交" onclick="alert('恭喜你的课程表已提交')">
效果如下图:
如果对以上代码不理解的可以进入( https://www.runoob.com/tags/ref-byfunc.html) 学习HTML标签
任务二,所见所得式开发
在code.org上完成网页开发的课程及系列任务https://studio.code.org/s/csd2-2019 ,根据提示做完即可。
三、扩展css盒子模型
盒子模型是html+css中最核心的基础知识,理解了这个重要的概念才能更好的排版,进行页面布局,下面是我借鉴某博主并加上自己的理解和完善的,附上代码以供后续小伙伴学习
<html>
<head>
<style> /*css的代码*/
body{
background-color:rgb(250,209,155);
}
div{
margin:10px;
}
.divbig1{
height:500px;
width:30%;
float:left;
background-color:rgb(250,209,155);
}
.divbig2{
height:500px;
width:65%;
float:left;
}
.div1{
height:100px;
width:90%;
background-color: rgb(54,222,31);
text-align:center
display: -moz-box; /*浏览器的兼容Firefox*/
display: -webkit-box;/*浏览器的兼容FSafari、Chrome*/
-moz-box-align: center;/*浏览器兼容Firefox*/
-webkit-box-align: center;/*浏览器兼容FSafari、Chrome */
-moz-box-pack: center;/*浏览器兼容Firefox*/
-webkit-box-pack: center;/*浏览器兼容FSafari、Chrome */
}
.div2{
height:375px;
width:90%;
background-color: rgb(54,222,31);
text-align:center
display: -moz-box;/*浏览器兼容Firefox*/
display: -webkit-box;/*浏览器兼容FSafari、Chrome*/
-moz-box-align: center;/*浏览器兼容Firefox*/
-webkit-box-align: center;/*浏览器兼容FSafari、Chrome */
-moz-box-pack: center;/*浏览器兼容Firefox*/
-webkit-box-pack: center;/*浏览器兼容FSafari、Chrome */
}
.div3{
height:150px;
width:90%;
background-color: rgb(54,222,31);
align-items: center;
}
.divbig3{
width:100%;
}
.div4{
height:325px;
width:48%;
background-color: rgb(54,222,31);
margin:0;
float:left;
text-align:center
display: -moz-box;/*兼容Firefox*/
display: -webkit-box;/*兼容FSafari、Chrome*/
-moz-box-align: center;/*兼容Firefox*/
-webkit-box-align: center;/*兼容FSafari、Chrome */
-moz-box-pack: center;/*兼容Firefox*/
-webkit-box-pack: center;/*兼容FSafari、Chrome */
}
.div5{
height:150px;
width:41%;
background-color: rgb(54,222,31);
float:left;
margin: 0px;
margin-left: 5px;
text-align:center
display: -moz-box;/*兼容Firefox*/
display: -webkit-box;/*兼容FSafari、Chrome*/
-moz-box-align: center;/*兼容Firefox*/
-webkit-box-align: center;/*兼容FSafari、Chrome */
-moz-box-pack: center;/*兼容Firefox*/
-webkit-box-pack: center;/*兼容FSafari、Chrome */
}
.div6{
height:165px;
width:41%;
background-color: rgb(54,222,31);
float:left;
margin-left: 5px;
margin-top: 10px;
text-align:center
display: -moz-box;/*兼容Firefox*/
display: -webkit-box;/*兼容FSafari、Chrome*/
-moz-box-align: center;/*兼容Firefox*/
-webkit-box-align: center;/*兼容FSafari、Chrome */
-moz-box-pack: center;/*兼容Firefox*/
-webkit-box-pack: center;/*兼容FSafari、Chrome */
}
.div7{
height: 100px;
margin: 20px;
width: 100px;
float: left;
background-color: aqua;
text-align:center
display: -moz-box;/*兼容Firefox*/
display: -webkit-box;/*兼容FSafari、Chrome*/
-moz-box-align: center;/*兼容Firefox*/
-webkit-box-align: center;/*兼容FSafari、Chrome */
-moz-box-pack: center;/*兼容Firefox*/
-webkit-box-pack: center;/*兼容FSafari、Chrome */
}
.div8{
height: 100px;
margin: 20px;
width: 100px;
background-color: aqua;
position: absolute;
right: 10%;
top: -20px;
text-align:center
display: -moz-box;/*兼容Firefox*/
display: -webkit-box;/*兼容FSafari、Chrome*/
-moz-box-align: center;/*兼容Firefox*/
-webkit-box-align: center;/*兼容FSafari、Chrome */
-moz-box-pack: center;/*兼容Firefox*/
-webkit-box-pack: center;/*兼容FSafari、Chrome */
}
.div9{
height: 100px;
margin: 20px;
width: 100px;
background-color: aquamarine;
position: absolute;
left: 35%;
top: 450px;
z-index: -1;
text-align:center
display: -moz-box;/*兼容Firefox*/
display: -webkit-box;/*兼容FSafari、Chrome*/
-moz-box-align: center;/*兼容Firefox*/
-webkit-box-align: center;/*兼容FSafari、Chrome */
-moz-box-pack: center;/*兼容Firefox*/
-webkit-box-pack: center;/*兼容FSafari、Chrome */
}
</style>
</head>
<body> /*html的代码*/
<div style="height: 520px">
<div class="divbig1" >
<div class="div1" >1</div>
<div class="div2">2</div>
</div>
<div class="divbig2">
<div class="div3">3
<div class="div7">7</div>
<div class="div8">8</div>
</div>
<div class="divbig3">
<div class="div4" >4</div>
<div style="width:100%">
<div class="div5">5</div>
<div class="div6">6</div>
</div>
</div>
<div class="div9">9</div>
</div>
</div>
</body>
</html>
效果图如下:
文字的居中(水平居中容易,垂直居中有点难度)博主研究了很长时间,如果有小伙伴还挺迷惑的,那就点击链接 https://blog.csdn.net/erdouzhang/article/details/71110316 学习相关的内容
自测:
1.HTML5为了使img元素可拖放,需要增加什么属性
<img draggable="true">
2.HTML5哪一个input类型可以选择一个无时区的日期选择器
<input type="date">
3.CSS盒子模型中的margin,border,padding都是什么意思
1.外边距(margin)
2.边框(border)
3.内边距(padding)
4.说出5种常见的HTML事件
Window 事件属性,表单事件,键盘事件,鼠标事件,媒介事件
5.HTML的onblur和onfocus是哪种类型的属性
onblur失去焦点事件 onfocus 获得焦点事件
6.怎么设置display属性值使容器成为弹性容器?
- flex-direction 容器内项目的排列方向(默认横向排列)
- flex-wrap 容器内项目换行方式
- flex-flow 以上两个属性的简写方式
- justify-content 项目在主轴上的对齐方式
- align-items 项目在交叉轴上如何对齐
- align-content 定义了多根轴线的对齐方式。如果项目只有一根轴线,该属性不起作用。
7.Javascript种有多少种不同类型的循环?
有三种分别是:
for循环;do..while循环;while循环
8.用户搜索某个单词后,JavaScript高亮显示搜索到的单词,使用哪个语义化标签最适合
<mark>
总结:
愈学习,愈发现自己无知,