设置超出的部分:显示(默认)visible/隐藏hidden/滚动显示scroll
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Titletitle>
<style>
body>div{
width: 200px;
height: 200px;
border: 1px solid red;
/*设置超出的部分:显示(默认)visible/隐藏hidden/滚动显示scroll*/
overflow: scroll;
}
body>img {
width: 100px;
/*设置行内元素垂直对齐方式:
top上对齐,
middle中间对齐
bottom下对齐,
baseline基线对齐*/
vertical-align: bottom;
}
style>
head>
<body>
<input type="text"><img src="../imgs/a.jpg" alt="">
<div>
<img src="../imgs/a.jpg" alt="">
div>
body>
html>
position使元素脱离文档流
z-index值越大层级越高
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Titletitle>
<style>
#d1{
width: 100px;
height: 50px;
background-color: red;
position: absolute;/*position会让div脱离文档流*/
/*层级越大显示约靠前*/
z-index: 1;
}
#d2{
width: 50px;
height: 100px;
background-color: blue;
position: absolute;
z-index: 2;
}
style>
head>
<body>
<div id="d1">div>
<div id="d2">div>
body>
html>
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Titletitle>
<style>
#i1{
width: 21px;
height: 21px;
display: block;
background-image: url("https://game.gtimg.cn/images/lol/v3/topfoot-spr.png");
background-position: -381px -39px;
}
#i2{
width: 16px;
height: 24px;
display: block;
background-image: url("https://game.gtimg.cn/images/lol/v3/topfoot-spr.png");
background-position: -303px -84px;
}
a{
background-image: url("https://game.gtimg.cn/images/yxzj/web201706/images/comm/logo.png");
display: block;
width: 200px;
height: 54px;
}
style>
head>
<body>
<a href="">a>
<i id="i1">i>
<i id="i2">i>
body>
html>
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Titletitle>
head>
<body>
<video id="bg" poster="https://ys.mihoyo.com/main/_nuxt/img/47f71d4.jpg"
loop muted AUTOPLAY CONTROLS
style="width: 1576.89px; height: 887px;">
<source src="https://ys.mihoyo.com/main/_nuxt/videos/3e78e80.mp4" type="audio/mp4">
您的浏览器不支持播放此视频.
video>
video>
body>
html>