摘要: 1、hover是鼠标移动到当前标签上时,对应的css属性生效。 padding是给a标签按上、右、下、左的顺序加上边框 hover下面的属性: background-color: blue;当鼠标移动到使用hover的标签上时,该属性生效。 <!DOCTYPE html><html lang="en 阅读全文
posted @ 2020-02-27 18:00 凸凸yolotheway 阅读(314) 评论(0) 推荐(0) 编辑
摘要: 1、position:fixed 该属性是 固定在浏览器的某个位置,针对的是全局 (1)top:40px;距离顶部的距离为40px;left:20px;距离左边的距离为20px; <body> <div style="width: 40px;height: 25px;background-color 阅读全文
posted @ 2020-02-26 20:35 凸凸yolotheway 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 1、css边框: text-align: center; 水平方向居中line-height: 48px;跟标签高度一样,为竖直方向居中font-weight: bold;字体加粗 <body> <div style="border:1px dotted red"> 1234 </div> <div 阅读全文
posted @ 2020-02-20 11:30 凸凸yolotheway 阅读(291) 评论(0) 推荐(0) 编辑
摘要: 1、如果希望某个样式可以被多个文件使用,为了避免重复编写代码的繁琐,可以将该样式放入css文件中,其他文件通过link调用 新建一个css文件:common.css,写入某个样式: .c1{ background-color: red; color: white; } .c2{ font-size: 阅读全文
posted @ 2020-02-19 18:20 凸凸yolotheway 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 1、id选择器 如以下程序: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <style> #i1{ background-color: #2459a2; height: 48p 阅读全文
posted @ 2020-02-19 18:00 凸凸yolotheway 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 1、label标签, label标签中的for属性将label标签与input标签关联起来 <body> <label for="username">用户名:</label> <input id="username" type="text" name="user"/> <!-- label使用for 阅读全文
posted @ 2020-02-19 10:37 凸凸yolotheway 阅读(393) 评论(0) 推荐(0) 编辑
摘要: 1、table标签按规范来写,应该有表头与表内容 格式如下: <table border="1"> <thead> <tr> <th>表头</th> </tr> </thead> <tbody> <tr> <td>表内容</td> </tr> </tbody> </table> 如下为一个表格实例, 阅读全文
posted @ 2020-02-19 10:26 凸凸yolotheway 阅读(336) 评论(0) 推荐(0) 编辑
摘要: 1、超链接<a></a> 当href的值为一个地址时,点击百度字样可以调整到该地址; <body> <a href="http://www,baidu.com" target="_blank">百度</a> <!-- target="_blank",跳转到一个新页面打开百度页面--> <a href 阅读全文
posted @ 2020-02-18 20:26 凸凸yolotheway 阅读(295) 评论(0) 推荐(0) 编辑
摘要: 1、textarea标签 多行文本标签,可以输入多行,默认值写在标签中奖 <textarea name="meno">123456</textarea> 2、select标签 select设置下拉框,size为下拉框的尺寸,multiple按住ctrl键可以多选 <select name="city 阅读全文
posted @ 2020-02-18 17:15 凸凸yolotheway 阅读(261) 评论(0) 推荐(0) 编辑
摘要: 1、input系列 <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Title</title></head><body> <form action="http://localhost:8888/index" me 阅读全文
posted @ 2020-02-17 19:10 凸凸yolotheway 阅读(169) 评论(0) 推荐(0) 编辑