黑马程序员_学习日记57_702HTML

一、网站表单

<form>标签
<form method="post" action="">
	<table width="400px" align="center">
		<tr>
			<td><label for="txtName" accesskey="n">用户名:</td>
			<td><input id="txtName" name="txtname" type="text" size="20" readonly="readonly" value="123" ></td>
		</tr>
		<tr>
			<td>密码:</td>
			<td><input type="password" size="20"></td>
		</tr>
		<tr>
			<td>确认密码:</td>
			<td><input type="password" size="20"></td>
		</tr>
		<tr>
			<td>性别:</td>
			<td><input type="radio" name="sex" value="male"><label for=""></label></td>
		</tr>
		<tr>
			<td>
				<input type="checkbox">吃饭
				<input type="checkbox">吃饭
				<input type="checkbox">吃饭
			</td>
		</tr>
		<tr>
			<td><input type="submit" value="提交"/></td>
			<td><input type="reset" value="重置"/></td>
		</tr>
	</table>
</form>


 

二、 用ul和li做菜单(横向)

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <style type="text/css">
        #navi
        {
            list-style-type:none;
            cursor:pointer;
        }
        #navi li
        {
            margin-left:10px;
            text-align:center;
            float:left;
            width:100px;
            border-bottom:1px dashed red;
        }
    </style>
</head>
<body>
    <ul id="navi">
        <li>资源</li>
        <li>博客</li>
        <li>空间</li>
        <li>论坛</li>
    </ul>
</body>
</html>


 

三、DivCss布局一个页面框架


 

 
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <style type="text/css">
        *
        {
            margin:0px;
            padding:0px;    
        }
        #container
        {
           
            margin:0px auto;/* margin属性的auto值可以使控件居中显示 */
            background-color:Gray;
            width:90%;
            height:900px;    
        }
        #header
        {
            background-color:Red;
            height:150px; 
               
        }
        #sideBar
        {
            background-color:Blue;
            height:600px;
            width:15%;  
            float:left;  
        }
        #content
        {
            background-color:Green;
            height:600px;
            width:85%;  
            float:left;
        }
        #footer
        {
            background-color:Yellow;
            height:150px;  
        }
    </style>
</head>
<body>
    <div id="container">
        <div id="header"></div>
        <div id="body">
            <div id="sideBar"></div>
            <div id="content"></div>
        </div>
        <div style="clear:both"></div><!-- 用clear清除控件的float属性 -->
        <div id="footer"></div>
    </div>
</body>
</html>

 

四、控件盒子模型

 


                
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值