自己整理的HTML代码

个人摄影作品展示

  <input type="text" name="textfield">    //文本框

 

<select name="select">

    <option>列表菜单</option>

  </select>

----------------------------------------------------------

<input type="radio" name="radiobutton" value="radiobutton" checked>  单选按钮/其中checked为默认行为选中/

<input name="checkbox" type="checkbox" value="checkbox" checked>  复选框/其中checked为默认行为选中/

<input type="submit" name="Submit" value="提交">  按钮 

 

<textarea name="textarea" cols="90" rows="3"></textarea> 文本区域

 

style="width:580px;height:50px;border:solid 1px #000000;" 给文本区域加边框

--------------------------------------------------------------

<td style="border:solid 1px #37C5D9;">  定义默认边框宽度

 

<td style="border-top:solid 1px #37C5D9;  定义上边框宽度

           border-bottlom:solid 1px #ffffff;  定义下边框宽度

           border-right:solid 1px #ffffff;  定义右边框宽度

           border-left:solid 1px #ffffff;">   定义左边框宽度

-----------------------------------------------------------------------------------

页面顶部空隙

body {

     margin-top: 0px;

        margin-left: 0px;

}

 

<style type="text/css">

<!--

.style1 {font-family: "黑体"}

 

a{

  color: #000000;       //字体色

  text-decoration:none; //超连接去下划线

}

-->

</style>

 

<span style="color:#ffffff;"> 文字颜色 </span>

<span>样式1</span>

-------------------------------------------------------------------------------------

<span style="position:relative;left:11px;top:12px;>WARRANTY</span> //相对定位字的位置。

type="position:relative;right:1px;left:1px;top:1px;bottom:1px;"    //同上

<span style="position:absolute;left:11px;top:12px;>WARRANTY</span> //绝对定位字的位置。

type="position:absolute;right:1px;left:1px;top:1px;bottom:1px;"    //同上

-------------------------------------------------------------------------------

<style type="text/css">

...........

   #right{

    position:relative; top:-414px; //位置:相对的

    font-style:italic; //斜体

       width:150px;

       height:375px;

       float:left;   //浮动在左边

       font-family:tahoma;

       font-size:13px;

       color:#000000;

       font-weight:bold;

       text-align:right;

   }

</style>

需要先:

<div id="right">

内容

</div>

--------------------------------------------------------------------

 

常用字体:arial, verdana, helvetica, sans-serif;

格式1 <td><span>黑体</span></td>

格式2 <td><strong>加粗</strong></td>

格式3 <td><em>斜体</em></td>

 

font-style:italic; //斜体

------------------------------------------------------------------------

<table width="500" border="边框" cellspacing="间距" cellpadding="填充">

<tr> 行

<td> 列

</td>

</tr>

</table>

    <td colspan="3">合并3列</td>

    <td rowspan="5">合并5行</td>

 

background="images/terminatorscooter-homepage-.jpg"   背景图

--------------------------------------------------------------------------------------

<div style="margin-top:10px;padding-right:0px;">内容</div>

 

class用 .outo{    }

id用#outo{    }

------------------------------------------------------------------------------

 

style="background-repeat:no-repeat;"  //不允许背景图重复

 

---------------------------------------------------------------------------

java script

 

document.writeln(" 网页内容 ");   //java调用程序

 

<link rel="stylesheet" type="text/css" media="all" href="style/global_style.css">  //css应用

---------------------------------------------------------------------------------

常用字体:arial, verdana, helvetica, sans-serif;

position:relative;right:1px;left:1px;top:1px;bottom:1px; //相对定位

position:absolute;right:1px;left:1px;top:1px;bottom:1px; //绝对定位

 

text-decoration:none; //超连接去下划线

text-decoration:underline; //超连接下划线

 

<td colspan="3">合并3列</td>

<td rowspan="5">合并5行</td>

background="images/…"   背景图

background-repeat:no-repeat;  //不允许背景图重复

document.writeln(" 内容 ");   //java调用程序

 

<link rel="stylesheet" type="text/css" media="all" href="style/global_style.css">

<meta http-equiv="content-type" content="text/html; charset=gb2312">

 

<span style="color:#ffffff;"> 文字颜色 </span>

<span>黑体</span>

 

leftmargin=0  //左页边空白

topmargin=0  //顶页边空白

cellpadding=0 //填充

cellspacing=0 //间距

strong //加粗

 

&bull; //黑色小圈

&oline; //上划线

&larr; //左箭头

&uarr; //上箭头

&rarr; //右箭头

&darr; //下箭头

&harr; //双箭头

-----------------------------------------------------------------------------

style="background-repeat:no-repeat;"  //不允许背景图片重复出现

line-height:2px;    //字线高

text-decoration:none; //超链去下划线

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

style="position:relative; top:1px;"

<span style="color:#ffffff;font-size:12px;">文字</span>

<span>文字</span>

 

<meta name="keywords" content="HTML">  //给搜索引擎看要找的内容名

<meta http-equiv="Content-Type" content="text/html; charset=gb2312"> //浏览器用什么编码

 

class 用 .outo

id    用 #outo

&yen; 元符号

 

<style type="text/css">

body {margin:0; padding:0px;}  //整个页面边空白和填充

#header {margin: auto; height:70px; background-color:#d1c9df;}

#content {margin:0 auto; height:400px; background-color:#336699;}

#content #left {width:20%; height:100%; float:left; background-color:#f0f1c6;}

#content #right {height:100%; background-color:#ffffff;}

#footer {margin:0 auto; height:70px; background-color:#d1c9df;}

</style>

------------------------------------------------------------------------------------

<style type="text/css">

body

 {

  scrollbar-face-color: #b5daff;

  scrollbar-highlight-color: #ffffff;

  scrollbar-shadow-color: #000000;

  scrollbar-arrow-color: #0000ff;

  scrollbar-base-color: #6699ff;

  scrollbar-dark-shadow-color: #6699ff;

 }

</style>          //滚动条效果

-------------------------------------------------------------------------------


上一篇: HTML常用样式代码收集整理 下一篇:点文本后显示其它内容

评论