HTML&javaSkcript&CSS&jQuery&ajax(三)

來源:互聯網
上載者:User

標籤:表格   html元素   designed   body   nts   query   tool   float   文檔   

一、HTML塊元素

    1、區塊層級元素 Block level element ,內嵌元素 inline element , HTML<div>元素屬於區塊層級元素,他是組合其他HTML元素的容器,當與CSS一同使用<div>元素用於對大內容塊設定樣式屬性。<div>用於文檔布局,

    2、HTML  <span> 元素是內嵌元素,用於文本的容器,設定<div>元素的類,能夠為相同的<div>元素設定相同的類

         <!DOCTYPE html>
<html>
<head>
<style>
.cities{
background-color:green;
color:black;
margin:20px;
padding:20px;
}
</style>
</head>
<body>
<div class="cities">
<h2>London</h2>
<p>London is the capital ciry of England.<br/>
 It is the most populous city in the United Kingdom<br/>
with a metropolitan qrea of over 13 million inhabitants<br/>
</p>
</div>
</html>

   3、分行內元素, HTML<span>元素是行內元素,能夠範圍文本容器, 設定<span>元素的類,能夠為相同的<span>隱患蘇設定相同的樣式。

          <!DOCTYPE html >

     <html><head><style> span.red{color:red;}   </style></head><body>

 <h1> my <span class="red">Important</span>Heading</h1>

    4、使用<div>元素HTML布局,能夠對CSS進行定位

<!DOCTYPE html>
<html>
<head>
<style>
#header{
background-color:black;
color:white;
text-align:center;
padding:5px;
}
#nav{
line-height:30px;
background-color:#eeeeee;
height:300px;
float:left;
padding:5px;
}
#nac{
line-height:30px;
background-color:#eeeeee;
height:300px;
float:right;
padding:10px;
}
#section{
width:350px;
float:left;
padding:10px;
}
#footer{
background-color:black;
color:white;
clear:both;
text-align:center;
padding:5px;}
</style>
<body>
<div id="header">
<h1>City Gallery</h1>
</div>
<div id="nav">
London<br>
Paris<br>
Tokoy<br>
</div>
<div id="nac">
亞明<br>
倩倩<br>
愛你<br>
</div>
<div id="section">
<h1>London</h1>
<p>
London is the capital city of England. it is the most populars city in the United

Kingdom, with a metropolitan area of over 13 million inhabitants.
</p></div>
<div id="footer">
Copyright W3cSchool.com.cn</div>
</body>
</html>

  5、HTML表格定義

    <table>元素作用是顯示表格化的資料。

使用<table>元素能夠取得布局效果,通過CSS設定表格元素的樣式

<!DOCTYPE html>
<html>
<head>
<style>
table.lamp{
width:100%;
broder:1px solid #d4d4d4;}
table.lamp th td{
padding:10px;}
table.lamp td{
width:100px;
}
</style>
<body>
<table class="lamp">
<tr>
<th>
<img src="G:/MYXJ_20170721115944_save-01.jpeg" alt="Note"

style="height:200px;width:200px"></th>
<td> The table element was not designed to be layout tool</td></tr></table>

</body>
</html>

HTML&javaSkcript&CSS&jQuery&ajax(三)

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.