[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 强止杀进程
bool KillProcess(QString ProcessName){ bool result = false; QString str1; HANDLE hSnapShot = Create ...
- literal控件的例子
Literal的Mode属性,举例说明 这个属性的枚举值:PassThrough Encode Transform <%@ Page Language="C#" Auto ...
- android linearlayout 把控件view置底部(放在页面最下方)
<LinearLayout android:id="@+id/recLayout" android:layout_width="fill_parent" ...
- linux中grep的用法
http://www.9usb.net/200902/linux-grep.html http://blog.51yip.com/linux/1008.html http://blog.csdn.ne ...
- Uva 225 Golygons
这道题如果直接用Dfs,运气好的话是可以直接过的. 但如果要在Dfs的基础上加快速度,剪枝是必不可少的. 我的剪枝策略: 1.当前点(x,y)回到出发点至少需要 |x| +| y| 步,如果剩余的步数 ...
- Android图像篇
Android的渲染分为2D渲染和3D渲染两种,当中2D渲染的引擎为Skia.3D渲染的引擎是OpenGL ES.眼下.Android支持OpenGL ES1.0和OpenGL ES 2.0两种标准. ...
- Python 中的list小结
list的下标和子list list的下表从零开始,和C语言挺类似的,但是增加了负下标的使用. -len-----第一个元素 ...... ...... -2 ------ 倒数第二个元素 ...
- ios中利用NSDateComponents、NSDate、NSCalendar判断当前时间是否在一天的某个时间段内。
应用中设置一般会存在这样的设置,如夜间勿扰模式,从8:00-23:00,此时如何判断当前时间是否在该时间段内.难点主要在于如何用NSDate生成一个8:00的时间和23:00的时间,然后用当前的时间跟 ...
- POJ 2208 Pyramids 欧拉四面体
给出边长,直接就可以求出体积咯 关于欧拉四面体公式的推导及证明过程 2010-08-16 14:18 1,建议x,y,z直角坐标系.设A.B.C少拿点的坐标分别为(a1,b1,c1),(a2,b2,c ...
- 微信平台接入Web页面功能接口(C#)
微信平台接入web页面功能接口 今年因工作需要,通过微信平台接入公司的Wap页面,回忆下,记录内容,方面以后使用. 1.成为开发者后,你才可以使用公众平台的开发功能.需要填写URL和ToKen,接口配 ...