1.塊級(jí)元素和行內(nèi)元素有哪些彻桃?
- 塊級(jí)元素:
<div> ,<ul> ,<ol> ,<p> ,<h1>...<h6>, <table>, <caption>,<dt>...- 行內(nèi)元素:
,<span>,<font>,<cite>,<em>,<textarea>,<strong>,<img>,<input>,<lable>...
2.棧和隊(duì)列的區(qū)別有哪些忆矛?
- 棧是先進(jìn)后出,只能從表的一端進(jìn)行插入和刪除惠奸。
- 隊(duì)列是先進(jìn)先出,只能從表尾插入,在表頭刪除近刘。
3.選擇器有哪些雳殊,說出名稱并舉例橘沥。
1.ID選擇器:
<style type="text/css">
#name{color:red;}
</style>
<p id="name">你好</p>
2.類選擇器(class選擇器)
<style type="text/css">
.name{color:red;}
</style>
<p class="name">你好</p>
3.元素選擇器
<style type="text/css">
p{color:red;}
</style>
<p>你好</p>
4.子選擇器
<style type="text/css">
ul>li {color:red;}
</style>
<ul>
<li>你好</li>
</ul>
5.包含選擇器
<style type="text/css">
div p{color:red;}
</style>
<div>
<p>你好</p>
</div>
6.群組選擇器
<style type="text/css">
div ,p{color:red;}
</style>
<div>
<p>你好</p>
</div>
7.偽類選擇器
<style type="text/css">
a:hover{color:red;}
</style>
<a href=“#”>你好</a>
8.盒子模型
centent 為中心夯秃,可以設(shè)置width,height座咆。padding為內(nèi)邊距痢艺,有四個(gè)數(shù)值。padding的大小為boder的大小介陶。padding的外面是margin堤舒,跟padding一樣有四個(gè)數(shù)值 ,分別是left斤蔓,top植酥,right,bottom弦牡。也可以用兩個(gè)數(shù)值表示友驮,第一個(gè)表示上下,第二個(gè)表示左右驾锰。
9.水平居中的寫法有哪些卸留?寫代碼
- 文字居中:<p style="text-align:center">你好</p>
- div居中:<div style="margin(0,auto)"></div>
- ul,li 居中
<ul style="position:abslution;left:50%">
<li style="position:relactive ;right:50%">你好</li>
</ul>
10.JS基本數(shù)據(jù)類型有哪些椭豫?
JS 有五種數(shù)據(jù)類型:Undefined,Null,Boolean,Number,String