[Codecademy] HTML&CSS 第七课:CSS: An Overview
本文出自 http://blog.csdn.net/shuangde800
[Codecademy] HTML && CSS课程学习目录
------------------------------------------------------------------------------------------------
What CSS is(什么是CSS)
p {
color: red;
}
span {
/*Write your CSS here!*/
color: blue;
}
然后html文件中连接css文件后,直接使用<span>即可,就会自动设置css的样式:
<!DOCTYPE html>
<html>
<head>
<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
<title>Fancy Fonts</title>
</head> <body>
<p>I'm a paragraph written in red font, but one of my words is <span>blue</span>!</p>
</body> </html>
效果图:
Why sparate from function?(为什么要把功能分开?)
If it's in, it's out!(引用css文件)
<!DOCTYPE html>
<html>
<head>
<style>
p {
color: purple;
}
</style>
<title>Result</title>
</head>
<body>
<p>Check it out! I'm purple!</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Result</title>
<link type="text/css"; rel = "stylesheet"; href="stylesheet.css"></link>
</head> <body>
<p>I want to be SIZE 44 font!</p>
</body> </html>
PSA: Self-closing tags(自关闭标签)
CSS语法
One selector, many properties(一个selector,多个properties)
p {
font-family: Arial;
color: blue;
font-size: 24px;
}
/*You can do this! Write your CSS below.*/
h3 {
color:red;
}
p {
font-family:Courier;
}
span {
background-color:yellow;
}
index.html
<!DOCTYPE html>
<html>
<head>
<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
<title>I Know Kung Fu (er, CSS)</title>
</head>
<body>
<div>
<h3>What's CSS for?</h3>
<p>CSS is for styling HTML pages!</p>
<h3>Why use it?</h3>
<p>It makes webpages look <span>really rad</span>.</p>
<h3>What do I think of it?</h3>
<p>It's awesome!</p>
</div>
</body>
</html>
The importance of semicolons(分号的重要性)
CSS的注释
RGB模式颜色的十六进制值
Pixels and ems(像素)
A font of knowledge(字体的小知识)
serif: A font with little decorative bits on the ends of the strokes that make up letters. Do a search on "serif" to see what we mean.
sans-serif: A plain-looking font, like this one. It doesn't have the little doohickies on the ends of letters like a serif font does.
cursive: A scripty font! It looks like cursive writing.
/*Add your CSS below!*/
h1 {
font-family:serif;
}
h2 {
font-family:sans-serif;
}
h3 {
font-family:cursive;
}
index.html
<!DOCTYPE html>
<html>
<head>
<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
<title>Result</title>
</head>
<body>
<h1 >I'm going to be a serif font when I grow up!</h1>
<h2>I'm going to be a sans-serif font.</h2>
<h3>I'm going to be in cursive!</h3>
</body>
</html>
效果:
Backup values(备份值)
Border属性
Links and text decoration(链接和文字修饰)
a {
text-decoration: none;
}
text-decoration的几种属性:
h1 {text-decoration:overline} 上划线
h2 {text-decoration:line-through} 中划线
h3 {text-decoration:underline} 下划线
h4 {text-decoration:blink} 定义闪烁的文本
[Codecademy] HTML&CSS 第七课:CSS: An Overview的更多相关文章
- [Codecademy] HTML&CSS 第三课:HTML Basic II
本文出自 http://blog.csdn.net/shuangde800 [Codecademy] HTML && CSS课程学习目录 --------------------- ...
- [css]我要用css画幅画(七) - 哆啦A梦
接着之前的[css]我要用css画幅画(六),今天画的有所不同,画的是哆啦A梦,我们小时候对他的称呼其实是小叮当机器猫. (PS:这次我要做的事情,很多人已经做过,这并不是什么创新,我只是在学习并记录 ...
- CSS前5课总结
CSS<精通CSS.DIV网页样式与布局>视频前5课总结: 地对地导弹 第一课: 使用CSS控制页面: 1,行内样式 <p style="color:#0000FF; fo ...
- 萌新接触前端的第二课——CSS
前端知识——CSS CSS(英文全称:Cascading Style Sheets) 中文名层叠样式表,是一种用来表现HTML或XML等文件样式的计算机语言.CSS不仅可以静态地修饰网页,还可以配合各 ...
- 七种CSS左侧固定,右侧自适应两栏布局
一 两栏布局基本HTML和CSS 首先创建基本的HTML布局和最基本的样式. 基本的样式是,两个盒子相距20px, 左侧盒子宽120px,右侧盒子宽度自适应 <div class="w ...
- html学习第二天—— 第七章——CSS样式基本知识
外部式css样式,写在单独的一个文件中外部式css样式(也可称为外联式)就是把css代码写一个单独的外部文件中,这个css样式文件以“.css”为扩展名,在<head>内(不是在<s ...
- 妙味课堂——HTML+CSS(第三课)
常见标签我已经在上一篇文章中提及,我们做前端设计时,主要也是用这些标签(最常用的). 然而有一个问题,就是有的标签都有自己的默认样式.试通过如下代码来说明: <!DOCTYPE html> ...
- [HeadFist-HTMLCSS学习笔记][第七章CSS入门:加一点样式]
CSS入门 style元素设置CSS 基本格式 <style type="text/css"> body { background-color: #eaf3da; } ...
- 从零开始学习html(七)CSS样式基本知识
一.内联式css样式,直接写在现有的HTML标签中 <!DOCTYPE HTML> <html> <head> <meta http-equiv=" ...
随机推荐
- QT模态对话框用法(在UI文件中设置Widget背景图,这个图是一个带阴影边框的图片——酷)
QT弹出模态对话框做法: 1.新建UI文件时,一定要选择基类是QDialog的,我的选择是:Dialog without Buttons(),如下图: 2.然后在使用的时候: MyDialog dlg ...
- isdigit()判断是不是数字
string 里面的函数isdigit(),可以判断是不是数字. 或者,采用type(1)==int.
- cocos2d-x游戏开发系列教程-超级玛丽04-AppDelegate
代码下载链接 http://download.csdn.net/detail/yincheng01/6864893 解压密码:c.itcast.cn 背景 上一篇博文提到在CCApplication: ...
- 戴尔CEO:我们将专注于企业 而非手机业务
9月13日消息,据国外媒体报道,戴尔公司董事长兼首席执行官迈克尔·戴尔(Michael Dell)周五接受了CNBC采访,谈了他对戴尔未来的打算.此前一天,迈克尔·戴尔提出的以250亿美元将戴尔私有化 ...
- 数据库数据用Excel导出的3种方法
将数据库数据用Excel导出主要有3种方法:用Excel.Application接口.用OleDB.用HTML的Tabel标签 方法1——Excel.Application接口: 首先,需要要Exce ...
- DDL 和DML 区别
DML(Data Manipulation Language)数据操纵语言: 适用范围:对数据库中的数据进行一些简单操作,如insert,delete,update,select等. DDL(Data ...
- java数组中的三种排序方法中的冒泡排序方法
我记得我大学学java的时候,怎么就是搞不明白这三种排序方法,也一直不会,现在我有发过来学习下这三种方法并记录下来. 首先说说冒泡排序方法:冒泡排序方法就是把数组中的每一个元素进行比较,如果第i个元素 ...
- datetime.datetime.today()生成时间转换成unixtime
首先要将时间中秒后面的.及其以后的部分去掉,否则时间转换函数 currenttime=str((datetime.datetime.today())).split('.',2)[0] str((dat ...
- Verilog实现IIC通讯第二版
HMC5883三轴磁力传感器IIC通讯模块的VerilogHDL的实现 上一版并没有实现我想要的功能 0.0.1版 正在修订中 2013/9/2 //date :2013/7/7 //desi ...
- W3C 、HTML 、CSS 发展介绍
一.W3C W3C 指万维网联盟(World Wide Web Consortium),创建于1994年10月,由 Tim Berners-Lee (他是html的发明人)创建. W3C开始被创建的目 ...