教案:S2
授课教师:牟勇 课时: 100 分钟 l 本章技能目标 n 会创建统一外观的字体文本 n 会创建无下划线的超连接样式 n 会创建个性化的表格 n 会创建个性化的表单 l 本章重点 n CSS 语法规则 n CSS 常用属性 l 本章难点 n 会创建个性化的表格 n 会创建个性化的表单 l
授课教师:牟勇
课时:100分钟
l 本章技能目标
n会创建统一外观的字体文本
n会创建无下划线的超连接样式
n会创建个性化的表格
n会创建个性化的表单
l 本章重点
nCSS语法规则
nCSS常用属性
l 本章难点
n会创建个性化的表格
n会创建个性化的表单
l 本章工作任务
u 美化“宝贝分类”页面
u 制作并美化“注册”页面
l 整章授课思路
n本章共有共有三个知识点:CSS语法规则,CSS用法,CSS常用属性
n因为4.0的学员在S1就已经学习过CSS,所以CSS语法规则部分可以采用回顾的方式来进行。
nCSS用法依然可以采用回顾的方式进行。
nCSS属性重点讲述边框属性。
n教员应多与学员互动,让学员参与课堂教学过程,及时进行鼓励和表扬,增强学员自信心。
回顾: [5分钟]
表单中提交数据的方法有那两种及其区别?
创建一个登录界面需要哪些表单元素?
target属性取值可以为哪些及其含义?
预习检查: [5分钟]
简述样式表的基本结构?
常用的样式属性有哪些?
课程知识点讲解:
CSS样式表规则:[10分钟]
为什么需要CSS样式表
答案:HTML可以对网页进行描述,但是离做出漂亮的网页还差很远,另外,通常网页内容和网页的外观是由不同的人来完成的,如果都使用HTML会造成冲突。而如果外观使用CSS来完成就可以解决这个问题,另外,由于网页的内容和外观进行了分离,也就让我们可以实现同样的内容用不同的外观来显示,大大提高了网页的变化,降低了网页维护成本。
样式表的基本语法
提问:我们在S1的时候就已经学习过了CSS,现在谁来说说,样式表的基本语法?
答案:
选择器名{
属性:值;
}
提问:样式规则可以分为哪几类?
答案:HTML选择器,class选择器,id选择器。
出示静夜思案例:
HTMLp,那字体为什么会是红色的呢?指出是使用了HTML选择器,使p的样式发生了改变,并说明,所有的p都将受到样式表规则的影响。
问题:如果希望某几个p元素的样式不同于别的p,怎么办?
答案:类选择器。
.red { color:red; font-family:"隶书"; font-size:24px; } ……
问题:如果希望某个p元素的样式独一无二,怎么办?
答案:ID选择器
#red { color:red; font-family:"隶书"; font-size:24px; } ……
CSS三类应用方式:[20分钟]
引入:我们知道了样式表的写法,直接下来,我们怎么应用它们呢?
分类:
行内样式,内嵌样式,外部样式表
行内样式:
问题:如果希望某段文字和其他段落文字显示风格不一样(并且这个样式不会再其他地方反复使用了),如何解决?
答案:行内样式
写法:使用style属性
;"> 这个段落应用了样式
这个段落按默认样式显示
教员应说明:
内嵌样式:
问题:如果我们希望一个网页内的样式保持一种风格,如何解决?
答案:内嵌样式。
写法:使用
P { font-family:"隶书"; font-size:18px; color:#FF0000; }
…… 床前明月光, 疑是地上霜。 我是郭德刚, 低头思故乡。 ……
教员应说明:所有的段落都采用 P 样式,保证样式统一
外部样式表:
问题:如果我们希望一个网站内的所有网页都保持一种风格,我们又应该怎么解决?
答案:外部样式表。
写法:首先需要一个外部样式表文件(通常使用.css后缀),外部样式表文件的写法与内嵌样式的写法没有大的区别,不需要写。其次,我们需要在网页中导入外部样式表。
根据关联的方式可以分为两种:链接()和导入(@import)
链接的写法:
教员应强调三个属性的作用和写法。
导入的写法
@ import newstyle.css;
教员应强调:@import的结尾后需要加分号(这是学生很容易犯的错误)。
另外,教员应推荐学员使用@import,因为对于一些CSS支持不好的浏览器(主要指旧版本的浏览器)来说,它们会不支持@import,这样仅只是使外部样式表失效,而不至于把版面搞得很糟糕,甚至造成重要内容无法显示的情况。
CSS常用属性[50分钟]
引入:我们现在已经了解了样式表的语法,还有使用样式表的三种方式。通过前面的讲述,我们可以看出,写样式表,其实就是写它的各种属性。那样式表的常用属性有哪些?它们又有什么用处?我们一起来看一下。
文本属性
属性 |
说明 |
font-size |
字体大小 |
font-family |
字体类型 |
font-style |
字体样式 |
color |
字体颜色 |
text-align |
文本对齐 |
P { font-size: 12px; font-family: "宋体"; text-align:left; } .focus { font-size: 16px; color:red; }
【新闻】[设搜狐为首页] 9月1日 “focus">·世锦赛刘翔12秒95夺冠成就大满贯 ·我国实施不安全食品召回制度 遏制非法出口 …..
教员应强调:P用作整体样式的定义,而class样式用作特别需要强调的样式定义。并且强调class样式的名称应该以这个样式的作用来命名,而不应该以这个样式是什么样子来命名(以功能来命名,而不是根据颜色,位置等来命名)。
小结1:
编写如下图所示效果对应的HTML代码
/* 表格单元格大字体的样式*/ TD { font-size:20px; font-family:"黑体"; color:red; text-align:center; } /* 小字体的样式*/ .smallFont { font-size: 14px; color:blue; }
教员提供表格无样式的HTML,学员上机完成样式表。
背景属性:
属性 |
说明 |
background-image |
背景图像 |
background-color |
背景颜色 |
background-repeat |
背景平铺方式: repeat(默认,两个方向的平铺,即平铺满整个范围), repeat-x(横向平铺,即在一行上平铺), repeat-y(纵向平铺,即在一列上平铺), no-repeat(不平铺) |
…… table { background-image: url(images/type_back1.jpg); background-repeat:no-repeat; }
……
教员讲解上面的关键代码,并说明repeat各个取值的含义。
方框属性:
属性 |
说明 |
margin-top |
左边距 |
margin-right |
右边距 |
margin-bottom |
底边距 |
margin-left |
左边距 |
border-style |
边框样式 none : 无边框。与任何指定的border-width值无关 hidden : 隐藏边框。IE不支持 dotted : 在MAC平台上IE4+与WINDOWS和UNIX平台上IE5.5+为点线。否则为实线 dashed : 在MAC平台上IE4+与WINDOWS和UNIX平台上IE5.5+为虚线。否则为实线 solid : 实线边框 double : 双线边框。两条单线与其间隔的和等于指定的border-width值 groove : 根据border-color的值画3D凹槽 ridge : 根据border-color的值画菱形边框 inset : 根据border-color的值画3D凹边 outset : 根据border-color的值画3D凸边 |
border-width |
边框宽度 |
dorder-color |
边框颜色 |
padding-top |
顶部填充 |
padding-right |
右边填充 |
padding-bottom |
底部填充 |
padding-left |
左边填充 |
问题:要实现下图所示的效果,该如何编写样式规则?
关键代码:
.tableBorder { border-right-width: 3px; border-right-color:red; border-right-style:dashed; padding-top:20px; padding-left:10px; } TR { background:yellow; } …… 教员应重点讲解border各属性单词的意思及它们产生的效果,可以对应浏览器效果(例如注释部分代码)进行讲解。 细边框效果: 问题:要实现下图的效果,该如何编写代码? 关键代码:
.textBorder{ border-width:1px; border-style:solid; }
名字: 密码: size="21">
教员应重点说明border-width与border-style的意思与用法,在这里可以对border-style进行一个小结(内容见前面边框属性的表格) 超链接特殊样式 伪类 说明 a:link 超链接的默认样式 a:visited 超点击过的超链接样式 a:hover 鼠标停在超链接上的样式 a:active 鼠标按下但尚未松开时的样式 问题:如何编写下图中的超链接样式。 关键代码:
A { color: blue; text-decoration: none; } A:hover{ color: red; }
…… 教员应重点说明超链接伪类的写法(a与hover之间是冒号(:),而不是逗号(,),也不是分号(;)更不是点(.))。 小结2: 编写如下图所示效果对应的HTML代码 教员应提供框架(HTML),请二至三位学员上机做(CSS),其他学员用纸做,教员应提示关键代码的写法。
/*细边框的文本输入框*/ .textBaroder { border-width:1px; border-style:solid } A{ /*设置无下划线的超连接样式*/ color: blue; text-decoration: none; } A:hover{ /*鼠标在超链接上悬停时变为颜色*/ color: red; text-decoration:underline }
综合例子:要实现下图图片按钮的效果,该如何编写样式规则? 教员可以选择多个学员上机共同完成此案例。 方框属性有哪些常用属性?并分别说明其含义? 超链接样式有哪几种? 内嵌样式表、行内样式表、外部样式表文件分别适用什么场合? CSS命名语法 CSS常用属性
手机冲值
电子彩票
本章总结 [10分钟]
考核点
扩展部分:
学员问题汇总:
作业:

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Honkai Impact Railway Botio is a five-star character launched in version 2.2 of the game. Many players must be very curious about the skills of Honkai Impact Railway Botio, so next the editor will bring you the Honkai Impact Let’s take a look at the introduction to Dome Railway Potio’s skills. What are the skills of Collapse Star Railroad Potio? 1. Basic attack: Normal normal attack, has no effect. 2. Combat skill: Launch a desperate confrontation between yourself and the designated enemy, lasting two rounds. In a desperate situation, the enemy will enter a taunting state. Botio cannot use any combat skills, and his basic attack Shoes and Skull is enhanced into a Hammer Repeater. When the enemy/Botio is in a desperate confrontation and is attacked by the opponent, the damage will be increased by 30%/15%. If there is nothing on the field that can be attacked

What skills should I choose to go on an adventure to hunt for treasure and then defeat the Demon King Lilith? This is actually the golden character "Forbidden Witch" Lilith in the pass. She has a special ability that can increase the attack power by 10% in battle and can be superimposed infinitely, which is very suitable for us to fight. Take an adventure to hunt for treasures and then defeat the Demon King Lilith. What Lilith skills should you choose? Choose giant fireball, magic surge and magic diffusion. Giant fireball is our core output skill, and we can only use giant fire as the core. After all, we only brought This is the only output skill. Magic Surge and Magic Spread provide a large number of Buffs to further enhance the explosive output of one-on-one combat. The Giant Fireball spell has the highest single-target damage ever, up to tens of millions. The Giant Fireball spell requires more skill entries, and the three gold entries have greatly improved.

What are the skills of Giselle in the Immortal Family? Giselle is a magician who can cause corrosive damage to teammates. Giselle established an underground clinic and took in several wandering dark elves. When Lilith became the Black Moon Goddess, he became her chief assistant. , let’s take a look at the skills with the editor now! What are the skills of the Immortal Family Giselle? The mysterious elf mage traveled to the underground. The mute fire will burn with all its strength in the silence until the road to breakthrough destiny emerges... Giselle founded an underground medical center and adopted some incompetent people. A homecoming dark elf, Lilith served as her first assistant after she was promoted to Black Moon Goddess. Giselle's camp attributes: fire attribute. Keywords: group damage, single target damage increase. Suitable members: Mage Giselle Association Causes a large area of damage to the enemy and applies

What are the skills of the Jackdaw on the Collapsed Star Dome Railway? This is actually a 4-star physical output character. It is expected to be added to the card pool in version 1.5. Next is some tips and skills sharing about this character. If you have any ideas about this, you can take a look. I hope it will be helpful to you. You are useful. What are the skills of the Jackdaw on the Collapsed Star Dome Railway? 1. Combat skill: causes physical damage to the enemy and applies a "burden" effect. The effect is removed after teammates trigger the effect three times (or 2 rounds); 2. Finishing skill: on the target Teammates increase their attack speed and attack power by a certain amount, and recover 1 skill point. The bonus effect lasts for 2 rounds; 3. Talent: When teammates cause damage to enemies with the "burden" effect, they have a chance to recover 1 combat skill point. ; 4. Secret skill: randomly attack a unit and impose a "burden"

What are the skills of Immortal Family Lilith? Lilith is the boss of the drow clan, and she is also a powerful woman! On the continent of Kais, he is the Dark Moon God! She is a strong person in the dark system. She believes in an undying power. Destruction means new life. Death and regeneration are a cycle! What is the skill of Lilith of the Immortal Family? The tsundere girl controls the girl - Lilith! Black represents powerful black magic power. The dark red color represents the arrival of the black moon, which is destined to mean that destruction will follow. Behind the mask, she has an expression that can never be read. "No one can bully Luna, of course, except me~!" Lilith is the eldest sister of the drow! He is also the Black Moon God of Kais Continent! She masters powerful black magic and believes that destruction is rebirth.

What are Ruan Mei's skills in the Collapsed Star Dome Railway? Ruan Mei is a very powerful character. Her ability is to increase the team's output and movement speed. Most people don't know much about Ruan Mei's abilities, so I will explain it to you now. What are Ruan Mei's skills in the Collapsed Star Dome Railway? 1. Basic attack. Players can use basic attack to cause ice attribute attacks to the enemy, and the character's damage is okay. Note: Basic attacks can only damage a single designated enemy. 2. Secret skills 1. The character's skills can increase damage to all teammates. 2. Using Fuyu's gun gloves can increase Ruan Mei's attack damage. 3. Combat Skills 1. It can increase the movement speed of the team, calculated as a percentage. 2. The character's use of skills can improve the teammate's ability to defeat and the time it takes for the target to be defeated. 4. Improve the talent of the whole team against the weak ones

When we talk about programming languages and jobs, one programming language that comes to our mind is Java. Most companies around the world use Java. It's popular and there are many job opportunities. If you want to get a job with the help of Java skills in 2023, then this is good for you as Java skills can get you a job quickly. Plus, it can quickly advance your career. There is no magic trick that will make you find a job quickly. But your skills are like magic to you. Choose a job that satisfies you and a good environment that can greatly enhance your career. If you are a newbie and have experience, Java also provides you with a good job. Many companies use Java as the main program for their development. it

What are Qu Mu’s skills when he returns to the city of Heaven and Earth Tribulation? This character is a new character that will be released soon. After this character uses his attack skills, his strength will be greatly increased. Next, the editor will introduce you to the specific skills. Friends who are interested can come and take a look. What are Qu Mu’s skills when the Heaven and Earth Tribulation City Returns? Qu Mu’s ■Official Spellcaster ■Zodiac Return to Light Talent: Wenchang Xingyun (Heroic Spirit Star Level 3/4/5/6) After every other character on the field uses the damaging secret skill , and gain 1 layer of "Prosperity" status. After using the non-damaging secret skill, if you have more than or equal to 2 layers of "Chang Ming" status, you will gain another action (1/1/2/2 grids). At the end of this re-action, 2 layers of "Chang Ming" status will be reduced (interval 4/ Triggered on round 3/3/2). "Chang Ming": Each level of spell attack increases
