text-overflow:ellipsis;white-space: nowrap;overflow:hidden; 溢出:text-overflow: clip | ellipsis | string;
页面内跳转:onclick="location.href = 'homepage.html';" a、window.open('http://www.baidu.com')//但打开的是新窗口 b、onclick="javascript:window.location.href='homepage.html'"//跳转了 c、onclick="location='homepage.html'"//跳转了 d、如果页面中有frame可以将在location前面添加top.mainframe.frames['right_frame'].location e、 window.open('http://www.baidu.com','ssdd','dfsdf');//弹出新网页
background:-webkit-linear-gradient:top,#ccc,#000;background:-webkit-gradient(linear,center top,center bottom,#ccc,#000)
a、.css(“样式”):获得样式值,如$("input").css("color")获得input中字体的颜色 b、.css(“样式”,“value”):为样式赋值,如$("input").css("color","red"); c、.addClass(“样式类1,样式类2,样式类3”):可以添加多个定义好的样式类,如.addClass("active active1") 用空格隔开 d、.hasClass(“样式类类”):判断是否存在该样式,如.hasClass('active') e、.toggleClass(“样式类”):如果存在(不存在)就切换(删除)样式,如.toggleClass('active') f、.toggleClass(“样式类”,swith):如果swith为false,则删除样式,如果swith为true,则切换成该类 g、removeClass(“样式类”):移除样式类,如.removeClass('active') h、.css({样式名:“value”,样式名:“value”}):可以多次添加样式,如.css({‘border’:'1px red solid','width':'100px'})
transform:rotate(90deg);-ms-transform:rotate(90deg);-moz-transform:rotate(90deg); -webkit-transform:rotate(90deg);-o-transform:rotate(90deg);
半圆,高度是宽度的一半 border-radius:0px 0px 23px 23px;-webkit-border-radius:0px 0px 23px 23px;-moz-border-radius:0px 0px 23px 23px; 四分之一圆,高度宽度相等,只需设一个角;border-radius: 200px 0 0 0;
获取浏览器显示区域(可视区域)的高度:$(window).height(); 获取浏览器显示区域(可视区域)的宽度:$(window).width(); 获取页面的文档高度:$(document).height(); 获取页面的文档宽度:$(document).width(); 浏览器当前窗口文档body的高度:$(document.body).height(); 浏览器当前窗口文档body的宽度:$(document.body).width(); 获取滚动条到顶部的垂直高度 (即网页被卷上去的高度) :$(document).scrollTop(); 获取滚动条到左边的垂直宽度:$(document).scrollLeft(); 获取或设置元素的宽度:$(obj).width(); 获取或设置元素的高度:$(obj).height(); 某个元素的上边界到body最顶部的距离:obj.offset().top;(在元素的包含元素不含滚动条的情况下) 某个元素的左边界到body最左边的距离:obj.offset().left;(在元素的包含元素不含滚动条的情况下) 返回当前元素的上边界到它的包含元素的上边界的偏移量:obj.offset().top(在元素的包含元素含滚动条的情况下) 返回当前元素的左边界到它的包含元素的左边界的偏移量:obj.offset().left(在元素的包含元素含滚动条的情况下)
cursor:pointer手型 cursor:hand也是手型 cursor:crosshair十字型 cursor:help问号 cursor:text字形 cursor:wait等待 cursor:default默认 cursor:e-resize向右的箭头 cursor:ne-resize向右上箭头 cursor:n-resize向上箭头 cursor:nw-resize向左上箭头 cursor:w-resize向左箭头 cursor:sw-resize向左下箭头 cursor:s-resize向下右箭头 cursor:se-resize向下右箭头 css3鼠标特性 zoom-in放大镜 zoom-out放小镜 grab抓手 grabbing抓住手 兼容性: cursor: grab; cursor: -webkit-grab; cursor: -o-grab; cursor: -ms-grab; cursor: grab;
word-break:break-all//只对英文起作用,以字母作为换行依据 word-wrap:break-word//只对英文起作用,以单词作为换行依据 white-space:pre-wrap//只对中文起作用,强制换行 white-space:nowrap //想要文字不换行强制不换行 text-wrap: none//换行
text-align:justify;display:inline-block;
js语法表达中英文两端对齐: ox.style.textAlign = "justify"; box.style.letterSpacing = '-.15em'; box.innerHTML = box.innerHTML.split("").join(" ");
左上width: 0;height: 0;border-top: 100px solid red;border-right: 100px solid transparent; 右下width: 0;height: 0;border-bottom: 100px solid red;border-left: 100px solid transparent; 等边三角形 width: 0;height: 0;border-left: 50px solid transparent;border-right: 50px solid transparent;border-bottom: 100px solid red;