web前端

html

  input

<input type="text" name="username" placeholder="用户名"/>
<input type="submit" value="添加"/>
<input type="button" value="取消" />
<input type="file" name="fafafa" />
1<input type="radio" name="gender" value="1" />
2<input type="radio" name="gender" value="2" />
3<input type="radio" name="gender" value="3" />
1<input type="checkbox" name="gender" value="1" />
2<input type="checkbox" name="gender" value="2" />
<select name="city" multiple> (有multiple就是多选 没有就是单选)
<option value="sh">上海</option>
<option value="bj">北京</option>
</select>

  table

  <div>标签,白板

  span

  h系列

  

  <a>标签
    超链接 <a href=‘http://www.baidu.com’>百度</a>
    锚<a href=‘#其它标签的id’>  

  <img>标签
    <img src=''图片url'' title=''标题''

<form action="www.baidu.com" method="get">
<input type="text" name="q">
<input type="text" name="b">
</form>


 

css

1.在body中给每个标签上设置style属性:
  background-color
  height

2.head中这种style标签
  -id选择器 #i1{background-color:red; height:48px;}-----很少用,id不能重复
  -class选择器 .c1{background-color:red; height:48px;}---常用,class可以重复 *****
    <标签 class=''c1''><标签/>
  -标签选择器     
    div{...}
  -层级(关联)选择器(空格):  .c1 div .c2 span{...}      *****
  -组合选择器(逗号): #i1,#i2,#i3{...}               *****

body中的<div id=''i1''></div>即可应用上
在每个标签上设置style属性:
  background-color
  height

关于居中
position:fixed之后,无法使用margin:0 auto来实现居中,需要left:50%;top:50%;margin-left:-1/2width;margin-top:-1/2height;来居中

伪类

    

javascript

  写在<script> </script>中,    

  
 1 <body>
 2     <div id="i1">1234567890abcdefghijklmnopqrstuvwxyz</div>
 3     <script>
 4         function func(){            //先定义一个函数
 5             var tag = document.getElementById("i1")     //都是局部变量
 6             var content = tag.innerText     
 7             var a = content.charAt(0)
 8             var b = content.substring(1,content.length)
 9             tag.innerText = b+a
10         }
11         setInterval('func()',200)       //定时器
12 
13     </script>
View Code

   

posted @ 2017-12-05 16:23  Andy__li  阅读(126)  评论(0)    收藏  举报