HTML基础标签:
<!DOCTYPE html>
< html lang = " en" >
< head> < meta charset = " UTF-8" > < meta name = " viewport" content = " width=device-width, initial-scale=1.0" > < title> 1-5章标签及属性</ title>
< style> .pre { color : aqua; font-size : 30px; }
</ style>
</ head> < body bgcolor = " " > 第一二章及实训一:< br> 换行标签< br> < nobr> 强制不换行标签</ nobr> < p> 用作段落标记</ p> < pre> 原样显示文字</ pre> < center> 居中对齐标签</ center> < p align = " center" > 居中对齐</ p> < blockquote> 引文标签,文本会从常规文本中分离出来</ blockquote> < address> 署名标签</ address> < hr color = " red" width = " 50%" size = " 2" align = " left" noshade = " 水平线不出现阴影" > 水平分割线标签< h1> h1~h6</ h1> :标题文字标签< br> 表示空格< font face = " 字体" size = " 大小" color = " 颜色" > 内容</ font> < br> < b> 使用粗体显示内容</ b> < strong> 使用粗体并强调</ strong> < i> 使用斜体显示内容</ i> < em> 使用斜体并强调</ em> < del> 给文本划线表示被删除</ del> < q> 表示引用</ q> < small> 使用小一号字体</ small> < sub> 下标</ sub> < sup> 上表</ sup> < u> 在文字下增加下划线</ u> < span> 多用id或者class属性配合CSS给文本内容设置属性</ span> < marquee behavior = " 滚动方式" direction = " 滚动方向" bgcolor = " 背景颜色" width = " " height = " " hspace = " 和vspace滚动背景和其它元素的空白间距" loop = " 设置滚动循环次数" crollamount = " 设置每次移动的距离px" scrolldelay = " 设置每次移动后的间歇时间ms" > </ marquee> < header class = " header" > 定义页面的头部</ header> < nav class = " nav" > 定义页面的导航区域</ nav> < section class = " section" > 定义页面的内容区域</ section> < article class = " article" > 定义正文或内容</ article> < aside class = " aside" > 定义补充内容</ aside> < footer class = " footer" > 定义页面的尾部</ footer> 第三章及实训二:(列表,图片引用及其它标签)< br> < ol> < li> 有序列表</ li> < li> ol可以设置type属性:1,a,A,i,I</ li> </ ol> < ul> < li> 无序列表</ li> < li> 可以设置type属性:disc (实心圆点) circle(空心圆) square(实心方块)</ li> </ ul> < dl> < dl> 描述性列表</ dl> < dd> 会产生缩进效果</ dd> </ dl> < img src = " 图片路径" alt = " 此属性在图片无法加载时显示" width = " " height = " " title = " 鼠标停留在图片上显示的文字" border = " 设置图像边框大小" align = " 图片对齐方式" hspace = " 图像与文字左右的距离" vspace = " 图像与文字上下的距离" > < figure> < img src = " ./timg (3).jfif" alt = " " height = " 30" width = " 35" > < img src = " ./timg (3).jfif" alt = " " height = " 30" width = " 35" > < img src = " ./timg (3).jfif" alt = " " height = " 30" width = " 35" > < figcaption> 这是图片的图注内容,一组图片的描述</ figcaption> </ figure> < details open > < summary> 页面说明</ summary> 志不立天下无可成之事</ details> < hgroup> < progress max = " 100" value = " 66" > 表示运行中的进度条</ progress> </ hgroup> < p> 明天早上< time> 7:00</ time> 开始记单词</ p> < p> 在< time datetime = " 2020-05-20" > 有一个约会</ time> </ p> < p> 突出显示< mark> 文本</ mark> </ p> < p> 表示作品< city> 标题</ city> </ p> < element draggable = " true|false|auto" > < p draggable = " true" > 这是一个可以拖动的段落</ p> < p hidden > 这是一个被隐藏的段落。</ p> < p contenteditable = " true" spellcheck = " true" > 这是一个可编辑的段落</ p> 第四章及实训三,四:(超链接)< br> < a href = " 文件名" target = " " title = " 鼠标长落时显示的文字" > 链接文字(名字)</ a> 书签链接:< a name = " 建立书签" > 文字</ a> < a href = " #书签的名称" > 链接的文字</ a> < a href = " http://..." > 外部链接,链接其它网站时的形式(http://baidu.com)</ a> < a href = " mailto:邮件地址" > 发送邮件</ a> < a href = " ftp://服务器IP地址或地域名" > 链接文字</ a> < a href = " telent://服务器IP地址或域名" > 链接文字</ a> < a href = " 锚点名称" > 用于链接锚点的文字</ a> < a name = " #锚点名称" > 链接文字</ a> < a href = " 页面地址#锚点名称" > 用于链接锚点的文字</ a> 第五章:(音视频播放)< audio src = " ./周杰伦 - 稻香.mp3" autoplay controls loop > </ audio> < video src = " 视频地址" width = " " height = " " poster = " 图像地址" preload = " auto" > </ video> < audio controls > < source src = " " > < embed src = " " type = " audio/mp3" > </ audio> < iframe src = " https://www.baidu.com/" frameborder = " 0" > </ iframe> 第六、八章:(表格表单)< form action = " action" method = " POST:将表单值封装在消息主题,GET:将提交值发送给服务器" > < table border = " 1" align = " center" bordercolor = " 边框颜色" bgcolor = " 背景颜色" frame = " 设置表格的外边框,具体属性参考W3school" rules = " 设置表格的内边框,具体属性参考W3school,IE和谷歌浏览器不支持此属性" width = " " height = " " cellspacing = " 内框宽度值" cellpadding = " 文字与边框距离值" > < caption> 表格的标题</ caption> < thead> < tr align = " 垂直对齐方式" > < td> < input type = " 有很多属性值,具体参考W3school" name = " 表单元素名称" id = " 标识符,用于区别其它相同属性标签,复选框就需要设置不同id属性值" > </ td> < td rowspan = " 垂直跨度的行数" > 第一行第一列</ td> < td colspan = " 水平跨度的列数" > 第一行第二列</ td> </ tr> </ thead> < tbody> < tr> < td> < textarea name = " " id = " " cols = " 水平宽度" rows = " 垂直高度" > 文本域</ textarea> </ td> < td> < select name = " " id = " " > < option value = " 选项一" > 选项一</ option> < option value = " 选项二" > 选项二</ option> </ select> </ td> </ tr> </ tbody> < tfoot> < tr> < td> < input type = " text" id = " 下面是datalist属性时,必须设置相同的id属性与之连用" > < datalist id = " 需与上面input属性id相等" > < option value = " 会自动下拉value里面内容" > </ option> < option value = " 选中输入框时起效" > </ option> </ datalist> </ td> < td> </ td> </ tr> </ tfoot> </ table> </ form>
</ body>
</ html>
HTML表格详细介绍:
<!DOCTYPE html>
< html lang = " en" > < head> < meta charset = " UTF-8" > < meta name = " viewport" content = " width=device-width, initial-scale=1.0" > < title> 用HTML做表格</ title>
</ head> < body> < table border = " 1" align = " center" height = " " width = " " bordercolor = " green" cellspacing = " 内框宽度值" cellpadding = " 文字与边框距离值" background = " " > < caption> 表格的标题</ caption> < thead bgcolor = " " align = " " > < tr bordercolor = " 设置边框颜色" height = " " bgcolor = " " background = " " align = " 水平对齐方式" valign = " 垂直对齐方式" > < th> </ th> < th> 列名1</ th> < th> 列名2</ th> < th> 列名3</ th> </ tr> < tbody> < tr> < th> 列名1</ th> < td colspan = " 水平跨度的行数" align = " " bgcolor = " " > 第一行第一列</ td> < td bordercolor = " 单元格边框颜色" bordercolorlight = " 亮边框" bordercolordark = " " > 第一行第二列</ td> < td background = " " > 第一行第三列</ td> </ tr> </ thead> < tbody> < tr> < th> 列名2</ th> < td rowspan = " 垂直跨度的行数" > 第二行第一列</ td> < td> 第二行第二列</ td> < td> 第二行第三列</ td> </ tr> </ tbody> < tr> < th> 列名3</ th> < td> 第三行第一列</ td> < td> 第三行第二列</ td> < td> 第三行第三列</ td> </ tr> < tr> < th> 列名4</ th> < td> 第四行第一列</ td> < td> 第四行第二列</ td> < td> 第四行第三列</ td> </ tr> </ tbody> < tfoot> < tr> < td colspan = " 4" align = " center" > 志不立天下无可成之事</ td> </ tr> </ tfoot> </ table>
</ body> </ html>
HTML表单详细介绍:
<!DOCTYPE html>
< html lang = " en" >
< head> < meta charset = " UTF-8" > < meta name = " viewport" content = " width=, initial-scale=1.0" > < title> Document</ title>
</ head>
< body> < form action = " " method = " POST" > < input type = " 元素类型" name = " 表单元素名称" > 文本框:< input type = " text" > 密码框:< input type = " password" > 单选按钮:< input type = " radio" > 多选按钮:< input type = " checkbox" checked = " checked" > 默认选中 < input type = " button" onclick = " " value = " 普通按钮" > < input type = " submit" value = " 提交按钮" > < input type = " reset" value = " 清除重写" > 密码域:< input type = " password" name = " " size = " " maxlength = " 定义最多输入字符" > < textarea name = " " cols = " " rows = " " > 多行文本域,cols、rows表示列数和行数;readonly表示只读</ textarea> < select name = " " id = " " multiple = " multiple" > < option value = " " selected = " selected" > 默认选中菜单一</ option> < option value = " " > 菜单二</ option> < option value = " " > 菜单三</ option> </ select> < input type = " text" value = " " list = " MP" > < datalist id = " MP" > < option value = " HUAWER" > </ option> < option value = " SAMSUM" > </ option> < option value = " OPPO" > </ option> </ datalist> x</ form>
</ body>
</ html>
HTML5新的表单元素:
拾色器:< input type = " color" />
Date日期:< input type = " date" />
DateTime时间:< input type = " datetime" name = " time1" required />
Time时间:< input type = " time" name = " time2" />
Email:< input type = " email" required />
Number:< input type = " number" max = " 100" />
Range:< input type = " range" min = " 1" max = " 100" />
Tel:< input type = " tel" />
button提交按钮:< button type = " submit" > </ button>
SVG:
< svg xmlns = " http://www.w3.org/2000/svg" version = " 1.1" width = " 200" > < polygon points = " 0,0 100,0 100,100 0,100" style =" fill : rgb ( 25, 2, 228) ; " /> < circle cx = " 50" cy = " 50" r = " 50" style =" fill : aqua; " /> < line x1 = " 0" y1 = " 0" x2 = " 100" y2 = " 100" style =" stroke : orange; stroke-width : 10px; " /> < rect x = " 100" y = " 0" width = " 100" height = " 50" style =" fill : chartreuse; " /> < text x = " 50" y = " 50" > 这是SVG文字</ text>
</ svg>