时间:2023-10-02 19:42:01 | 来源:网站运营
时间:2023-10-02 19:42:01 来源:网站运营
从零开始,学习web前端之HTML基础:<!DOCTYPE html> 声明文档类型<html> 根标签 <head> 头部标签 <meta charset="utf-8" /> 编码方式:通用字符集 <title></title> 标题 </head> <body> 主体标签 </body></html><! Doctype html> <br/> <hr/><html></html> <head></head> <title></title><head><title></title></head> 父子<head></head><body></body> 兄弟姐妹<head> <meta charset="UTF-8"> <link rel="shortcut icon" href="img/logo.ico"/> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="description" content="个人简介"> <meta name="keywords" content="喻志强,个人网站,个人简介,喻志强的个人网站,喻志强的个人简介"/> <title>个人简介</title> <link rel="stylesheet" href="css/base.css"/> <script type="text/javascript" src="js/center.js"></script> </head>告诉浏览器以最新版本的ie内核去渲染页面或者使用Google Chrome Frame(谷歌内嵌浏览器框架GCF)去渲染页面<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">网页关键字,有利于seo的收录<meta name="keywords" content="喻志强,个人网站,个人简介,喻志强的个人网站,喻志强的个人简介"/>网页的描述<meta name="description" content="个人简介">网页重定向 2秒后跳转到百度首页<meta http-equiv="refresh" content="2;https://www.baidu.com/" />默认设置超链接打开新的窗口<base target="_blank" />网页的logo<link rel="shortcut icon" href="img/logo.ico" />链接外部样式表<link rel="stylesheet" href="css/base.css"/>链接外部js脚本<script type="text/javascript" src="js/center.js"></script><br/> 换行标签<hr/> 水平线<!DOCTYPE html><html> <head> <meta charset="utf-8" /> <title></title> </head> <body> 第一行<br/> 第二行 <hr /> </body></html><p></P> 文本段落标签<font>文本标签</font><strong>加粗</strong> <b>加粗</b><em>倾斜</em><i>倾斜</i><del>删除线</del><s>删除线</s><ins>下划线</ins><u>下划线</u><img src="img/34.jpg" alt="小狗" title="两只小狗" width="300px" />Src: 图片的来源 必写属性<a href="https://www.baidu.com/" target="_blank" title="百度官网">百度</a>href : 去往的路径(跳转的页面) 必写属性<div id="top">顶部</div>2.超链接到锚点<a href="#top">回到顶部</a>特殊字符<ul type="square"> <li>item</li> <li>item</li> <li>item</li> <li>item</li> <li>item</li></ul><ol type="1" start="2"> <li>item</li> <li>item</li> <li>item</li> <li>item</li> <li>item</li></ol><dl> <dt>标题</dt> <dd>内容</dd> <dd>内容</dd> <dd>内容</dd> </dl><table border="1px" width="500" height="300" cellpadding="0" cellspacing="0" > <caption>表头</caption> <thead> <tr> <td colspan="4">标题</td> </tr> </thead> <tbody> <tr> <td>1</td> <td>2</td> <td>3</td> <th>4</th> </tr> </tbody> </table><caption></caption><th></th>用法和td一样,标题的文字自动加粗水平居中对齐Valign=”top | middle | bottom”bordercolor="red"<form action='http://www.123.com/postValue' method="post"></form>属性:action:处理信息<input type="text" name="userName" />maxlength=“6” 限制输入字符长度<input type="password" name="pwd" />文本输入框的属性和密码输入框属性通用<input type="radio" name="gender" value="男" checked="checked"/>男<br /><input type="radio" name="gender" value="女" />女<br />只有将name的值设置相同的时候,才能实现单选效果。<input type="checkbox" name="sing" />唱歌<input type="checkbox" name="eat" />吃饭<input type="checkbox" name="game" />玩游戏checked=”checked” 设置默认选中项<select name="city"> <optgroup label="浙江省"> <option>杭州市</option> <option>洛阳市</option> <option>信阳市</option> <option>南阳市</option> </optgroup> </select>multiple=“multiple” 将下拉列表设置为多选项<optgroup></optgroup> 对下拉列表进行分组。<textarea name="introduce" cols="20" rows="5"> </textarea>cols 控制输入字符的长度。<input type="file" multiple="multiple" accept="application/msword" />multiple=“multiple” 多选<input type="submit" value="注册" />具有提交功能<input type="button" value="按钮" />普通按钮,一般配合js使用<input type="image" src="img/34.jpg" width="100" />重置按钮<input type="reset" value="重置" />将信息重置到默认状态<form> <fieldset> <legend>注册</legend> </fieldset></form><fieldset></fieldset> 对表单信息分组<legend></legend> 表单信息分组名称<input type="url" /> 网址输入框<input type="date" /> 日期控件<input type="time" /> 时间控件<input type="email" /> 邮件输入框<input type="number" step="2" /> 数字,step:步长<input type="range" /> 滑块控件还有很多其他的控件例如:<form action="register.jsp" method="get"> <fieldset> <legend>注册</legend> 用户名:<input type="text" name="userName" value="yzq" /><br /> 密码:<input type="password" name="pwd" /><br /> <input type="checkbox" name="sing" />唱歌 <input type="checkbox" name="eat" />吃饭 <input type="checkbox" name="game" />玩游戏<br /> <input type="radio" name="gender" value="男" checked="checked"/>男<br /> <input type="radio" name="gender" value="女" />女<br /> <select name="city" multiple="multiple"> <option>杭州市</option> <optgroup label="浙江省"> <option>杭州市</option> <option>洛阳市</option> <option>信阳市</option> <option>南阳市</option> </optgroup> </select> <br /> <textarea name="introduce" cols="20" rows="5"> </textarea><br /> <input type="file" multiple="multiple" accept="application/msword" /> <input type="submit" value="注册" /> <input type="button" value="按钮" /> <input type="image" src="img/34.jpg" width="100" /> <input type="reset" value="重置" /> <input type="url" /> <input type="date" /> <input type="time" /> <input type="email" /> <input type="number" step="2" /> <input type="range" /> </fieldset></form>关键词:基础,学习