week4.md - jenny126/wp109b GitHub Wiki
<!DOCTYPE html>
<html>
<head>
<style>
div p {
color: cornflowerblue;
}
</style>
<p>156166</p>
<div>
<p>00000</p>
<section><p>123123</p></section>
</div>
<p>null</p>
</head>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
div >p {
color: cornflowerblue;
}
</style>
<p>156166</p>
<div>
<p>00000</p>
<section><p>123123</p></section>
<p>21221211212121</p>
</div>
<p>null</p>
<P>kfpokvvpfodkkvpod</P>
</head>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
div +p {
color: cornflowerblue;
}
</style>
<p>156166</p>
<div>
<p>00000</p>
<section><p>123123</p></section>
<p>21221211212121</p>
</div>
<p>null</p>
<P>kfpokvvpfodkkvpod</P>
</head>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
div ~p {
color: cornflowerblue;
}
</style>
<p>156166</p>
<div>
<p>00000</p>
<section><p>123123</p></section>
<p>21221211212121</p>
</div>
<p>null</p>
<P>kfpokvvpfodkkvpod</P>
</head>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
div
{
background-color: cornflowerblue;
width: 100px;
height: 200px;
border: 15px dotted blueviolet;
overflow: visible;
}
</style>
<div>
<p>
this is my code</p>
</div>
</head>
</html>
overflow: hidden
<!DOCTYPE html>
<html>
<head>
<style>
div
{
background-color: cornflowerblue;
width: 100px;
height: 200px;
border: 15px dotted blueviolet;
overflow: hidden;
}
</style>
<div>
<p>
this is my code</p>
</div>
</head>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
div
{
background-color: cornflowerblue;
width: 100px;
height: 200px;
border: 15px dotted blueviolet;
overflow: scroll;
}
</style>
<div>
<p>
this is my code</p>
</div>
</head>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
div
{
background-color: cornflowerblue;
width: 100px;
height: 200px;
border: 15px dotted blueviolet;
overflow: auto;
}
</style>
<div>
<p>
this is my code</p>
</div>
</head>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
img{
float: right;
}
</style>
<p>
this is my code
<img src="https://github.com/jenny126/wp109b/blob/main/pic/egpic.jpg?raw=true"width:auto;height:auto;>
this is my code
</p>
</head>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
img{
float: left;
}
</style>
<p>
this is my code
<img src="https://github.com/jenny126/wp109b/blob/main/pic/egpic.jpg?raw=true"width:auto;height:auto;>
this is my code
</p>
</head>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
img{
float: none;
}
</style>
<p>
this is my code
<img src="https://github.com/jenny126/wp109b/blob/main/pic/egpic.jpg?raw=true"width:auto;height:auto;>
this is my code
</p>
</head>
</html>
- clear: left; 左邊必須淨空
- clear: right; 右邊必須淨空
overflow: auto;
添加overflow使物件不會溢出範圍
- display: inline; 在行文之間的方框,不會干擾版面的配置
- display: inline-block; 根據設定的長寬而干擾版面配置的方框(干擾行距)
- display: block; 直接按照設置的長寬設置文字方框,並且會自動換行
<!DOCTYPE html>
<html>
<head>
<style>
span.a{
display: inline;
width: 50px;
height: 50px;
padding: 2px;
border: 1px solid green;
background-color: aqua;
}
span.b{
display: inline-block;
width: 50px;
height: 50px;
padding: 2px;
border: 1px solid green;
background-color: aqua;
}
span.c{
display: block;
width: 50px;
height: 50px;
padding: 2px;
border: 1px solid green;
background-color: aqua;
}
</style>
</head>
<body>
<h1>display: inline</h1>
<div>display: inlinedisplay: inlinedisplay: inlinedisplay: inlinedisplay: inlinedisplay: inlinedisplay: inlinedisplay: inlinedisplay: inline<span class="a">display: inline</span><span class="a">display: inline</span> display: inline</div>
<h1>display: inline-block</h1>
<div>display: inline-blockdisplay: inline-block<span class="b">display: inline-block</span>k<span class="b">display: inline-block</span>display: inline-block</div>
<h1>display: block</h1>
<div>display: blockdisplay: block<span class="c">display: block</span><span class="c">display: block</span>display: block</div>
</body>
</html>
0413 補充:display的32種寫法
ex. hover(將滑鼠移動到範圍內) a.highlight:hover or div:hover
Pseudo-classes和Pseudo-elements說明
- Vertical Navigation Bar
- Horizontal Navigation Bar
- Horizontal Navigation Bar active
- Horizontal Navigation Bar some at right
- Horizontal Navigation Bar fixed
- Horizontal Navigation Bar sticky
- Horizontal Navigation Bar dropdown navbar 下拉式選單
- 應用a
- 應用b
-
important:屬性選擇器的區別 *
此類用法很像if的用法,利用替物件命名的class作為搜索關鍵字,利用關鍵字來替物件套用格式
border-radius: xxpx;
利用此讓矩形得直角變得有弧度
border-radius: 15px 50px 30px 5px;
輸入多於一種的值,讓不同直角產生不同弧線
很帥的東西,一個延遲伸長(?)的部分,雖然很帥但我應該暫時不會用