1.div划分【样式控制】
<style>
div {
border: 1px solid pink;
width: 60%;
height: 500px;
margin: auto;
text-align: center;
}
</style>
2.div浮动样式
<style>
div {
border:1px solid pink;
}
.left {
width: 20%;
height: 500px;
float: left;
}
.center {
width: 60%;
height: 500px;
float: left;
}
.right {
width: 19%;
height: 500px;
float: left;
}
.footer {
clear: both;
text-align: center;
background-color: blueviolet;
}
</style>
3.图片插入
<body>
<img src="../images/1.jpg" title="广告" alt="图片找不到啦" width="150px" height="150px"/>
<img src="https://img2.baidu.com/it/u=143818365,1814365001&fm=26&fmt=auto&gp=0.jpg" width="200px"/>
</body>
4.超链接
<style>
a {
text-decoration: none;
color: black;
}
a:hover {
color: red;
}
</style>
5.添加背景图片
<style>
body {
background: url("../images/2051454.jpg");
}
</style>
6.表单的相关标签
<body>
<form action="#" method="get" autocomplete="off">
<label for="usename">用户名:</label>
<input type="text" id="usename" name="usename" placeholder="请在此处输入用户名" required/>
<label for="password">密码</label>
<input type="password" id="password" name="password" placeholder="请在此处输入用户名" required/>
<label for="tel">密码</label>
<input type="tel" id="tel" name="tel" placeholder="请在此处输入电话号码"/>
<button type="submit">提交</button>
<button type="reset">重置</button>
<button type="button">按钮</button>
</form>
</body>
7.其他表单的相关标签
<body>
<form action="#" method="get" autocomplete="off">
所在城市:<select name="city">
<option>---请选择城市---</option>
<optgroup label="直辖市">
<option>北京</option>
<option>上海</option>
</optgroup>
<optgroup label="省会市">
<option>杭州</option>
<option>武汉</option>
</optgroup>
</select>
<br/>
个人介绍:<textarea name="desc" rows="5" cols="20"></textarea>
<button type="submit">提交</button>
<button type="reset">重置</button>
</form>
</body>