6.28(HTML)

来源:互联网 发布:凡科建站能做seo吗 编辑:程序博客网 时间:2024/05/18 00:38

(1)HTML基本格式

<!DOCTYPE html><!--注释解释文本信息-->
<html>
<head><!--不会显示在页面中-->
  <meta charset="UTF-8">
  <title>hello</title>
  <!--<link rel="stylesheet" type="text/css" href="mystyle.css">-->

  <style type="text/css">

body{

 background-color: pink;
}
  </style>
</head>
<body bgcolor="#ffcc00">

<a href="#yy">goto</a>
hello world!</br>你好世界雷好啊!!!

 <p style="background-color:blue",width:20px>hahahahahahahahah</p>
 <h1 align="right">hahahahahahahahah</h1>
 <h2>hahahahahahahahah</h2>
 <h3>hahahahahahahahah</h3>
 <h4>hahahahahahahahah</h4>
 <h5>hahahahahahahahah</h5>
你好!

    <a href="http://www.baidu.com">duangduang</a>
    <a target=_blank href="http://www.baidu.com">
    <img src="C:\Documents and Settings\Administrator\桌面\46546465.bmp" alt="hh"><br/>

 

 2.HTML列表

 

 &nbsp 静夜思<br/>
<b>窗前明月光</b><br/>
<small>疑是地上霜</small><br/>
<strong>举头望明月</strong><br/>
<del>低头思故乡</del><br/>

 

有序列表:
<ol type="I">
<li>c</li>
<li>c++</li>
<li>java</li>
<li>html</li>

 

无序列表:

</ol>
<ul type="square">
<li>c</li>
<li>c++</li>
<li>java</li>
<li>html</li>

</ul>

 

自定义列表:

<dl>
 <dt>水果
   <dd>java</dd>
  
   <dd> web</dd>
 
</dt>

 <dt>设计
   <dd>HEML</dd>
  
   <dd>ANDROID</dd>
 
</dt>

</dl>

 

嵌套列表:

<ol type="I">
<li>水果
<ul type="desc">
<li>apple</li>
<li>c++</li>
<li>java</li>
<li>html</li>

</ul>


</li>
<li>蔬菜</li>

<ul type="square">
<li>c</li>
<li>c++</li>
<li>java</li>
<li>html</li>

</ul>
</ol>

 

<p id="yy"name="a1"> hfgfdgfdgfdgfdsg </p>

3.【知识点】HTML链接

外部链接:<a></a>

内部链接:(name,Id)

ID用法代码如下:<a href="#yy">goto</a>

<p id="yy"name="a1"> hfgfdgfdgfdgfdsg </p>

 

<!-点击goto跳转下处内容      -à

 

name:用法http://www.360doc.com/content/14/0502/18/14075153_374005138.shtml

 

 (4)合并表

<table border="3"width:"300"   style="background-color:green" cellspacing="1"
cellpadding="25">
  <caption>weather</caption>
  <tr >
    <td colspan=3><center>123</center></td>
    

  </tr>

<tr >
    <td>4</td>
     <td rowspan=2>58</td>
 <td>6</td>
   
  </tr>

 

  <tr>
    <td>7</td>
    
     <td>9</td>

   
  </tr>
 
 
</table >

 

 

 <table width="200" height="100" cellspacing="5" cellpadding="3" style="background-color:pink" border="1" bordercolor=black>
   <caption><center>1234</center></caption>
   <!--<th><center>11223344</center></th>-->
   <tr>
    <td>111</td>
    <td>222</td>
    <td rowspan=2>&nbsp;</td>
   </tr>
   <tr>
    <td valign="bottom">333</td>
    <td valign="bottom">444</td>
   </tr>
  </table>

 (5)设计表

 

 

 

无序表:属性:Disc 空心圆 circle 实心圆 square 矩形

 

有序表:属性:查书。

 

实践:有序表和无序表的嵌套。

<!--colspan是列合并,rowspan是行合并。

  cellspacing:单元格之间的距离也就是边框的厚度。

 

Cellpadding:字与边框的距离为5像素。

 

设置表格背景颜色:style="background-color:red"

 

 

(6)引入CSS样式表:1.新建文件CSS

2.编写代码:body{

 

background-color:pink;

 

 

}

 

1. 在title后引入

 

<link rel="stylesheet" type="text/css" href="mystyle.css">

 

 

2. 页面刷新,即可看到新添加的样式。

 

 

<!--div相当一个容器-->
<!--
<div style="width:100px; heigth:100px; background-color:red border:1">

<div style="width:90px; heigth:90px; background-color:red border:1">

<tablewidth="50" height="50" cellspacing="5" cellpadding="3" style="background-color:pink" border="1" bordercolor=black>

<caption><center>1234</center></caption>-->
   <!--<th><center>11223344</center></th>-->
   <!--<tr>
    <td>111</td>
    <td>222</td>
    <td rowspan=2>&nbsp;</td>
   </tr>
   

</table>

</div>

 

</div>-->

 

 


</body>

</html>

0 0