最近简单HTML
Hello!Hello, world!
HTML中form表单
FormsFavorite Color:
Blue
Green
Yellow
Red
相对比较复杂的HTML
超链接href
有序列表和无序列表
图片
表格
HTML ElementsA Large Heading
A Smaller Heading
The Smallest Heading
A bold word and an italicized word!
View the CS50 Website!
An unordered list:
- foo
- bar
- baz
An ordered list:
- foo
- bar
- baz
An image:
OceanAverage DepthMaximum Depth
Pacific4280 m10911 mAtlantic3646 m8486 mCSS简介
在HTML中嵌入CSS
Hello!A Colorful Heading!
Hello, world!
指定整个 body的样式
Hello!A Colorful Heading!
Hello, world!
将CSS放在前面
Hello!h1 {
color: blue;
text-align: center;
}
A Colorful Heading!
Hello, world!
单独的CSS文件
h1 {
color: blue;
text-align: center;
}
Hello!A Colorful Heading!
Hello, world!
给表格添加CSS
table {
border: 1px solid black;
border-collapse: collapse;
}
td {
border: 1px solid black;
padding: 2px;
}
th {
border: 1px solid black;
padding: 2px;
}
table {
border: 1px solid black;
border-collapse: collapse;
}
td, th {
border: 1px solid black;
padding: 2px;
}
更复杂的CSS
Pseudoclassesbutton {
background-color: red;
width: 200px;
height: 50px;
font-size: 24px;
}
button:hover {
background-color: green;
}
Button 1
Button 2
Button 3
来源:oschina
链接:https://my.oschina.net/u/4316165/blog/4696355