JavaScript学习笔记1

html常用标签   简单的css样式

<title>页面标题</title>

<!-- 标题  h1~h6都是标题标签 -->:<h1>静夜思</h1>

<!-- 段落标签 P -->:<p>床前明月光,疑是地上霜。</p>

<!-- 照片 img -->:  <img src="./image/preview.gif" alt="失败了" />

<!-- 超链接  a-->: <a href="https://www.baidu.com/">连接到百度</a>

<!-- 表格 table -->:<table> </table>

表格行: <tr> <td>  </td>   </tr>

横跨列:  <td colspan="2">1-2</td>  

横跨行:<td rowspan="2">2-1</td>

<!-- 列表 -->

<!-- 有序列表   有序号 ol-->

<ol>

<li>苹果</li>

<li>香蕉</li>

<li>橘子</li>

<li>西瓜</li>

<li>梨</li>

</ol>

<!-- 无序序列  没有序号 ul -->

<ul>

<li>苹果</li>

<li>香蕉</li>

<li>橘子</li>

<li>西瓜</li>

<li>梨</li>

</ul>

对指定的元素属性进行设置

<style>

table,td{

border:1px solid deeppink;

border-collapse: collapse;

}

td{

width: 70px;

text-align: center;

}

</style>

<body>

<form action="提交表单的地址" method="提交的方式 get/post">

<!-- 表单中的组件 -->

<input type="text" name="username" /><label>账号</label>

<!-- 密码框  password-->

<input type="password" name="userpass" /><label>密码</label>

<!-- 只读readonly-->

<input type = "text" readonly value = "20060804006" name="code">

<!-- 隐藏域  -->

<input type="hidden" value="10010" name="Id"/>

<div>

<!-- 单选框 radio   -->

<!-- 在一个表单的name一样的单选框会产生互斥性 -->

<input type="radio" value="M" name="sex" id="sexman" /><label for="sexman">男</label>

<input type="radio" value="W" name="sex" id="sexwoman" /><label for="sexwoman">女</label>

</div>

<!-- 复选框  checkbox  不可用 disabled-->

<div>

<input type="checkbox" name="hobby" id="sing" value="sing" /><label for="sing">唱</label>

<input type="checkbox" name="hobby" id="jump" value="jump" /><label for="jump">跳</label>

<input type="checkbox" name="hobby" id="rap" value="rap" /><label for="rap">RAP</label>

</div>

<div>

<!-- 下拉框   select   内容  option  默认选中select-->

<label>省份</label><select name="province" id="province">

<option value="">山东省</option>

<option value="">安徽省</option>

<option value="">新疆维吾尔自治区</option>

<option value="">陕西省</option>

<option value="">云南省</option>

</select>

</div>

<div>

<!-- 文本域 多行文本框  textarea 两个标签中的值就是他的值  注意不要回车-->

<textarea></textarea>

</div>

<button type="submit">提交按钮</button>

<button type="button">普通按钮</button>

<button type="reset">重置按钮</button>

<input type="button" value="普通按钮Input"/>

<input type="submit" value="提交按钮Input"/>

<input type="reset" value="重置按钮Input"/>

<!-- 只有在表单中才有作用 -->

</form>

</body>

<style>

/* 内部样式 */

/* 选择器 */

/* ID选择器 */

#boxa{

height: 100px;

width: 100px;

background-color: blueviolet;

/* 字体颜色 */

color: green;

font-size: 30px;

text-align: center;

/* 单行文本垂直居中 */

line-height: 100px;

/* 字体加粗 */

font-weight: bold;

}

/* 标签选择器  元素选择器 */

div{

height: 100px;width: 100px;

}

/* 类选择器  class='gbred' */

.bgred{

background-color: red;

display: none;

}

</style>

</head>

<body>

<!-- 内联样式 -->

<div style="width: 100px;height: 100px;background-color: pink;"></div>

<div id="boxa">你好</div>

<div class="bgred"></div>

<div></div>

</body>

  • 5
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值