HTML

  • 网页的组成
  • HTML简介
  • HTML的语法
  • HTML的常用标签
  • HTML中的表格和表单
  • CSS的简单应用



我们这里使用WebStorm开发工具

配置浏览器



  • 常用插件:

    • CodeGlance 代码缩略图插件







div布局

代码

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>div布局</title>
<style type="text/css">
body {
margin: 0px;
} #container {
width: 100%;
height: 950px;
background-color: #9e5ea5;
} #heading {
width: 100%;
height: 10%;
background-color: #df89ff;
} #content_menu {
width: 30%;
height: 80%;
background-color: #ff309e;
float: left;
} #content_body {
width: 70%;
height: 80%;
background-color: #7fffd4;
float: left;
} #footing {
width: 100%;
height: 10%;
background-color: cadetblue;
clear: both;
}
</style>
</head>
<body>
<div id="container">
<div id="heading"> 头部</div>
<div id="content_menu"> 内容菜单</div>
<div id="content_body"> 内容主题</div>
<div id="footing"> 底部</div>
</div>
</body>
</html>
  • 创建一个新html文件试试 ! 或者 html:5然后按Tab建试试效果吧

  • p.bar#foo这样可以生成一个p标签拥有class=bar和id=foo















1.HelloWorld案例


我是页面左上角标题


我是一个段落标签

我这个字不会换行
我这个字不会换行
我这个字加入了换行的单标签

我是1级

我是2级

我是3级

我是4级

我是5级
我是6级

加粗字体标签

定义大号字体(过时)

着重标签

斜体字

小号字

定义加重语气

123定义下标字123

123定义上标字123

定义插入字(文字有下划线)

定义删除字(文字被杠掉)

点我去百度

点我去百度

点击跳转到“点我去百度”

代码

<!DOCTYPE html>
<!--头文件 不是标签 也没有结束,这是声明该文件为HTML5-->
<html lang="en">
<!--表示网页文字以什么格式显示 en为英文 zh是中文-->
<head>
<!--头文件-->
<meta charset="UTF-8">
<!--编码格式为UTF-8-->
<title>我是页面左上角标题</title>
<!--头标题-->
</head>
<body bgcolor="#fff8dc" >
<!--background="http://img2.imgtn.bdimg.com/it/u=2974104803,1439396293&fm=200&gp=0.jpg"-->
<!--身体 加背景颜色 加背景图片-->
<p>我是一个段落标签</p>
我这个字不会换行
我这个字不会换行
我这个字加入了换行的单标签<br/>
<h1>我是1级</h1>
<h2>我是2级</h2>
<h3>我是3级</h3>
<h4>我是4级</h4>
<h5>我是5级</h5>
<h6>我是6级</h6>
<br/>
<b>加粗字体标签</b>
<br/>
<big>定义大号字体(过时)</big>
<br/>
<em>着重标签</em>
<br/>
<i>斜体字</i>
<br/>
<small>小号字</small>
<br/>
<strong>定义加重语气</strong>
<br/>
123<sub>定义下标字</sub>123
<br/>
123<sup>定义上标字</sup>123
<br/>
<ins>定义插入字(文字有下划线)</ins>
<br/>
<del>定义删除字(文字被杠掉)</del>
<br/>
<br/>
<a name="tobaidu" href="http://www.baidu.com">点我去百度</a>
<img src="http://img2.imgtn.bdimg.com/it/u=2974104803,1439396293&fm=200&gp=0.jpg" alt="我是图片不显示的时候出现的字"width="80px" height="80px">
<!--src放置图片地址 可以放网页图片地址 也可以放自己存入的图片地址-->
<p align="center"><a name="tobaidu" href="http://www.baidu.com" target="_blank" >点我去百度</a></p>
<!--标签是可以嵌套的-->
<br/><br/>
<br/><br/>
<br/><br/>
<br/><br/>
<a href="#tobaidu">点击跳转到“点我去百度”</a>
<!--文件内跳转-->
</body>
</html>

2.基础表格案例

表格

表头
单元1 单元2 单元3
单元1 单元2 单元3
单元1
  1. 1
  2. 2
  • 1
  • 2
    无序列表(disc默认实体圆 circle空心圆 square方块 )

  • 1
  • 2
  • 3
    有序列表(A用大写字母A开始 a小写a开始 I大写杠杠数字 i小写杠杠数字 strart=“10”从数字10开始)

  1. 1
  2. 2
  3. 3
(自定义列表,没有有序无序的列表前缀)

hello
SBSBSBSBSBSB
hello
SBSBSBSBSBSB
hello
SBSBSBSBSBSB

代码

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>表格</title>
</head>
<body>
<table border="1" cellpadding="10" cellspacing="10" bgcolor="aqua">
<caption>表头</caption>
<!--(边框为1)(内容与表格边距10)(表格间距10)(表格颜色)-->
<tr>
<th>单元1</th>
<th>单元2</th>
<th>单元3</th>
</tr>
<tr>
<td>单元1</td>
<td>单元2</td>
<td>单元3</td>
</tr>
<tr>
<td>单元1</td>
<td><ol>
<li>1</li>
<li>2</li>
</ol></td>
<td><ul>
<li>1</li>
<li>2</li>
</ul></td>
<tr>
<td colspan="3">
<ul type="disc">无序列表(disc默认实体圆 circle空心圆 square方块 )
<li>1</li>
<li>2</li>
<li>3</li>
</ul>
<ol type="A" start="10">有序列表(A用大写字母A开始 a小写a开始 I大写杠杠数字 i小写杠杠数字 strart=“10”从数字10开始)
<li>1</li>
<li>2</li>
<li>3</li>
</ol>
<dl> (自定义列表,没有有序无序的列表前缀)
<dt>hello</dt>
<dd>SBSBSBSBSBSB</dd>
<dt>hello</dt>
<dd>SBSBSBSBSBSB</dd>
<dt>hello</dt>
<dd>SBSBSBSBSBSB</dd>
</dl>
</td>
</tr>
</tr> </table>
</body>
</html>

2.基础表格案例

表格

表头
单元1 单元2 单元3
单元1 单元2 单元3
单元1
  1. 1
  2. 2
  • 1
  • 2
    无序列表(disc默认实体圆 circle空心圆 square方块 )

  • 1
  • 2
  • 3
    有序列表(A用大写字母A开始 a小写a开始 I大写杠杠数字 i小写杠杠数字 strart=“10”从数字10开始)

  1. 1
  2. 2
  3. 3
(自定义列表,没有有序无序的列表前缀)

hello
SBSBSBSBSBSB
hello
SBSBSBSBSBSB
hello
SBSBSBSBSBSB

**代码**

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>表格</title>
</head>
<body>
<table border="1" cellpadding="10" cellspacing="10" bgcolor="aqua">
<caption>表头</caption>
<!--(边框为1)(内容与表格边距10)(表格间距10)(表格颜色)-->
<tr>
<th>单元1</th>
<th>单元2</th>
<th>单元3</th>
</tr>
<tr>
<td>单元1</td>
<td>单元2</td>
<td>单元3</td>
</tr>
<tr>
<td>单元1</td>
<td><ol>
<li>1</li>
<li>2</li>
</ol></td>
<td><ul>
<li>1</li>
<li>2</li>
</ul></td>
<tr>
<td colspan="3">
<ul type="disc">无序列表(disc默认实体圆 circle空心圆 square方块 )
<li>1</li>
<li>2</li>
<li>3</li>
</ul>
<ol type="A" start="10">有序列表(A用大写字母A开始 a小写a开始 I大写杠杠数字 i小写杠杠数字 strart=“10”从数字10开始)
<li>1</li>
<li>2</li>
<li>3</li>
</ol>
<dl> (自定义列表,没有有序无序的列表前缀)
<dt>hello</dt>
<dd>SBSBSBSBSBSB</dd>
<dt>hello</dt>
<dd>SBSBSBSBSBSB</dd>
<dt>hello</dt>
<dd>SBSBSBSBSBSB</dd>
</dl>
</td>
</tr>
</tr> </table>
</body>
</html>



3.div布局及table布局案例

table布局

table布局

这是头部
左菜单 右菜单
底部

代码

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>table布局</title>
</head>
<body marginheight="0px" marginwidth="0px">
<table width="100%" height="950px" style="background-color: aqua">
<tr>
<td colspan="2" width="100%" height="10%" style="background-color: #9e5ea5" align="center">这是头部</td>
</tr>
<tr>
<td width="30" height="80%" style="background-color:blue" align="center">左菜单</td>
<td width="70" height="80%" style="background-color:blueviolet" align="center">右菜单</td>
</tr>
<tr>
<td colspan="2" width="100" height="10%" style="background-color:darkcyan">底部</td>
</tr>
</table>
</body>
</html>

div控制

div控制

#t1,#t2,#t3,#t4 {
border: 1px solid red;
width: 400px;
height: 150px;
font-size: 35px;
}

    .temple2 {
/*隐藏超出的区域*/
overflow: hidden;
} .temple3 {
/*显示滚动条*/
overflow: scroll;
} .temple4 {
/*自动设置是否显示滚动条*/
overflow: auto;
}
</style>
床前明月光,
肚子饿得慌。
举头望腊肉,
低头闻香肠。
床前明月光,
肚子饿得慌。
举头望腊肉,
低头闻香肠。
床前明月光,
肚子饿得慌。
举头望腊肉,
低头闻香肠。
床前明月光,
肚子饿得慌。
举头望腊肉,
低头闻香肠。

代码

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>div控制</title>
<style>
div {
border: 1px solid red;
width: 400px;
height: 150px;
font-size: 35px;
} .temple2 {
/*隐藏超出的区域*/
overflow: hidden;
} .temple3 {
/*显示滚动条*/
overflow: scroll;
} .temple4 {
/*自动设置是否显示滚动条*/
overflow: auto;
}
</style>
</head>
<body>
<div class="temple">
床前明月光,<br/>
肚子饿得慌。<br/>
举头望腊肉,<br/>
低头闻香肠。
</div>
<br/><br/><br/><br/><br/><br/>
<div class="temple2">
床前明月光,<br/>
肚子饿得慌。<br/>
举头望腊肉,<br/>
低头闻香肠。
</div>
<br/><br/><br/><br/><br/><br/>
<div class="temple3">
床前明月光,<br/>
肚子饿得慌。<br/>
举头望腊肉,<br/>
低头闻香肠。
</div>
<br/><br/><br/><br/><br/><br/>
<div class="temple4">
床前明月光,<br/>
肚子饿得慌。<br/>
举头望腊肉,<br/>
低头闻香肠。
</div>
</body>
</html>

div布局


div布局

body {
margin: 0px;
}

    #container {
width: 100%;
height: 950px;
background-color: #9e5ea5;
} #heading {
width: 100%;
height: 10%;
background-color: #df89ff;
} #content_menu {
width: 30%;
height: 80%;
background-color: #ff309e;
float: left;
} #content_body {
width: 70%;
height: 80%;
background-color: #7fffd4;
float: left;
} #footing {
width: 100%;
height: 10%;
background-color: cadetblue;
clear: both;
}
</style>
头部
内容菜单
内容主题
底部

代码

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>div布局</title>
<style type="text/css">
body {
margin: 0px;
} #container {
width: 100%;
height: 950px;
background-color: #9e5ea5;
} #heading {
width: 100%;
height: 10%;
background-color: #df89ff;
} #content_menu {
width: 30%;
height: 80%;
background-color: #ff309e;
float: left;
} #content_body {
width: 70%;
height: 80%;
background-color: #7fffd4;
float: left;
} #footing {
width: 100%;
height: 10%;
background-color: cadetblue;
clear: both;
}
</style>
</head>
<body>
<div id="container">
<div id="heading"> 头部</div>
<div id="content_menu"> 内容菜单</div>
<div id="content_body"> 内容主题</div>
<div id="footing"> 底部</div>
</div>
</body>
</html>

第一章 HTML+CSS(上)的更多相关文章

  1. 《css3实战》读书笔记 第一章 基于CSS需求而编写的HTML.

    笔记说明 <CSS3实战手册第3版(影印版)>可以消除Web设计工作的痛苦,并且带给你:HTML--重新入门.如果你是HTML新手,你会学到如何以CSS友好的方式进行基本页面构造.若你是H ...

  2. 第一章 Html+Css使用总结(下)

    1 开场 <!DOCTYPE html> <html lang="en"> <head> <!-- 对于中文网页需要使用 <meta ...

  3. 第一章 HTML+CSS(中)

    4.域元素(form表单.textarea文本域.fieldset域集合.input使用) 案例 表单 用户名: 密码: 昵称: 你喜欢的水果有? 苹果 黄瓜 香蕉 请选择性别 男 女 请选择你要的网 ...

  4. 大型分布式架构设计与实现-第一章SOA(面向服务的体系架构)

    拜读了大型分布式架构设计与实现,觉得该书作为入门不错,但内容过于简单,描述过于琐碎,小节之间连续性不强,不适合深入钻研学习.但为了更多的希望向架构师行业靠拢的工程师学习需要,本博客将对上书进行简化讲解 ...

  5. (linux shell)第一章--小试牛刀(上)

    来源:(linux shell)第一章--小试牛刀(上) 从今天開始,我们一起来学习<linux shell脚本攻略>这本书. 1.1简单介绍 shell脚本一般是一个以#!起始的文本文件 ...

  6. PHP第一章学习——了解PHP(上)

    计划开启PHP学习教程,情况如下: 1.采用教程35章48个视频文件 2.时间4月29日-5月6日 共计8天 3.具体划分每天学习章节数不少于5个,预留5-6号时间为五一假期出玩情况 4.要求认真学习 ...

  7. 《Django By Example》第一章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:本人目前在杭州某家互联网公司工作, ...

  8. 【php学习】PHP 入门经典第一章笔记

    第一章: php在线手册:http://php.net/manual/zh/index.php 在开始学习PHP之前,先来看一个合格的PHP程序员今后应具备哪些知识,这里只是笔者的一些总结,希望对读者 ...

  9. 第一章:Javascript语言核心

    本节是javascript语言的一个快速预览,也是本书的第一部分快速预览. 读此书之前,感谢淘宝技术团队对此javascript核心的翻译,感谢弗拉纳根写出此书.感谢你们无私的分享,仅以此笔记献给你们 ...

随机推荐

  1. 智能合约遇到的小错误 network up to date解决办法

    https://blog.csdn.net/qindong564950620/article/details/68933678 说 network up to date .这个错误我刚开始不知道怎么解 ...

  2. Redhat配置yum源(使用阿里云yum Repo)

    1. 查看版本号和系统类别: cat /etc/redhat-release archor cat /etc/issue && arch 2.检查yum是否安装,以及安装了哪些依赖源并 ...

  3. 力扣(LeetCode)605. 种花问题

    假设你有一个很长的花坛,一部分地块种植了花,另一部分却没有.可是,花卉不能种植在相邻的地块上,它们会争夺水源,两者都会死去. 给定一个花坛(表示为一个数组包含0和1,其中0表示没种植花,1表示种植了花 ...

  4. 开源项目Zookeeper、Doozer、etcd进行总结

    Jason Wilder的一篇博客对分别对常见的服务发现开源项目Zookeeper.Doozer.etcd进行了总结介绍: Zookeeper是一个用户维护配置信息.命名.分布式同步以及分组服务的集中 ...

  5. javax.net.ssl.SSLException: Certificate doesn't match any of the subject alternative names

    问题:在使用 org.apache.http.*下的 CloseableHttpClient 发送https请求时报了以上错误 解决方案一:使用java.net.HttpURLConnection i ...

  6. 简单函数template max

    #include <iostream> #include <vector> #include <algorithm> #include <string> ...

  7. 【Java集合系列二】LinkedList解析

    一.简介 1.LinkedList继承关系 2.LinkedList底层实现 LinkedList使用双向链表存储数据,所以没有默认的容量,也不会有扩容一说.只有两个指针,永远指向链表的两端:firs ...

  8. C语言的通用指针类型(void *)

    reference: https://blog.csdn.net/cumirror/article/details/4631701 https://blog.csdn.net/Lee_Shuai/ar ...

  9. JAVA 程序的基本语法

    首先看我们的第一个java程序: public class HelloWorld { public static void main(String[] args) { System.out.print ...

  10. Linux:CentOS 7系统的安装

    相信有看过我写的博文就知道我写的第一篇博文就是CentOS 7系统的安装,不过是在虚拟机中安装的,而且还是直接加载镜像文件进去的,不过这次我就通过PE来安装,来证实下PE是否可以用来安装Linux系统 ...