
html+css
雨夜星辰03
学无止境
展开
-
css两种居中方式对比
1.浮动始终上下左右居中 body{ background: yellow; padding:0; margin: 0; } #fixed-div{ width: 200px; height: 200px; background: slateblue; position: fixed; margin:auto;原创 2017-03-04 09:48:55 · 514 阅读 · 0 评论 -
chrome浏览器获取图片的宽高为0
类似如下的图片,display:none; 1.在火狐浏览器中获取高度和宽的是可以获取到的width 和 height试了多种网上的方法都没用例如下面这种网上的方法,根本没用var img = new Image; img.onload = function(){ alert ( img.width ); }; img.sr...原创 2018-08-02 10:54:19 · 772 阅读 · 0 评论 -
css3渐变透明遮盖
background: -webkit-gradient(linear, 0 0, 0 100%, from(rgba(255, 255, 255, 0)), to(#fff)); background: -moz-linear-gradient(top, rgba(255, 255, 255, 0), #fff); background: -o-linear-gradi...转载 2018-07-17 09:09:09 · 9135 阅读 · 0 评论 -
横屏竖屏图片背景固定底部js
/** * @author zhengzhen * @version V1.2 * * 背景图片固定到屏幕底部 * 根据屏幕大小动态设置背景层图片, * 并且不随内容滚动而滚动 * 同时监听屏幕横屏竖屏 ,变化背景 * 修改bgImgUrl为你自己的图片背景 *//** * 追加样式 */var bgImgUrl="../img/bg.png";$(document....原创 2018-04-27 15:32:17 · 1122 阅读 · 3 评论 -
长按放大全屏图片js
/** * @author zhengzhen * @version v1.2 * 2018-4-27 * 长按全屏放大图片js * 使用方法在文档最后引用该js,不需要放大的图片请添加上not-big样式 * 例如:<img src="xxxxxx" class="not-big"/> */var viewportSize = getViewportSize();...原创 2018-04-27 15:21:08 · 715 阅读 · 0 评论 -
【转载】css垂直居中的11种方式
转载自:https://www.cnblogs.com/zhouhuan/p/vertical_center.html注:以下demo都只是针对现代浏览器所做,未兼容低版本的IE以及其它非主流浏览器。 11种实现方式分别如下:1. 使用绝对定位和负外边距对块级元素进行垂直居中html代码:<div id="box"> <div id="child">我是测试DIV&...转载 2018-04-26 17:46:08 · 208 阅读 · 0 评论 -
Uncaught TypeError: XXX is not a function解决
转载:https://blog.youkuaiyun.com/u011870547/article/details/52765811后台没有错误,前端一直显示 Uncaught TypeError: withdraw is not a function 错误,代码如下:<div class="form-group btn-right"> <button type="button" c...转载 2018-05-03 20:59:02 · 10498 阅读 · 1 评论 -
浏览器自动填充导致input无法回显问题解决方法
浏览器的自动填充导致我的用户编辑回显的数据被覆盖了,百度了很多方案都不太方便和兼容性不好!受http://www.qiusuoweb.com/37.html这个博客启发,想到一种通用性更好的方案如下,特意记载下来!解决:解决浏览器自动填充导致input数据不回显问题方案: 在input标签内加上下面代码autocomplete="off" readonly="true" onclick="this...原创 2018-05-02 20:41:51 · 1392 阅读 · 1 评论 -
python解决js文件utf-8编码乱码问题
html文件中引入js文件,显示乱码!js文件为utf-8 编码(无bom) ,此时只要将js文件转成utf-8 BOM编码就可以解决了可以使用notepad++转码也可以使用下面的python代码批量转码# -*- coding:utf-8 -*- import os,sysimport chardet def convert( filename, in_enc = "GBK", ...原创 2018-05-02 11:25:53 · 1302 阅读 · 0 评论 -
浏览器获取长按选中,双击选中内容
/** * @author Dongxu Huang, Shu Ke, Wang Lei * @date 2013-07-08 */document.addEventListener("mousemove", update_mouse_pos, true);document.addEventListener("mouseup", on_mouse_up, true);documen...转载 2018-04-14 10:25:19 · 1000 阅读 · 0 评论 -
三级联动
<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title></title> </head> <body> 国家: <select id="s1" on原创 2018-04-12 20:26:45 · 199 阅读 · 0 评论 -
一个html元素内有多个html元素,让子元素并排自动换行居中,且有间距
一个html元素内有多个html元素,让子元素并排自动换行居中,且有间距如下 .innerdiv{ width:50px; height: 50px; background: yellow; display: inl原创 2017-07-19 17:37:56 · 3007 阅读 · 0 评论 -
js和jquery中各种宽高坐标
js相关宽高 第一章.window和document对象 一.window和document有什么区别 window指的就是浏览器的窗口,包括工具栏,地址栏等等 window一般可以省略 Document对象是Window对象的一部分 document.body实质上是window.document.bo...原创 2017-05-26 16:31:17 · 467 阅读 · 0 评论 -
jquery-weui-1.0.1弹出popup层多次点击以后无法弹出层解决方法
最近用jquery-weui做手机页面,发现popup层弹出多次以后点击无法弹出层了,进入假死卡死状态,调试发现在每次弹出popup层之前调用了一次关闭层的操作为什么在调用打开层的方法中调用关闭的方法?最后发现只要注释关闭的方法就可以解决多次点击以后卡死的状态原创 2017-04-28 15:48:38 · 2898 阅读 · 0 评论 -
CSS:display各个值区别
inline:内联元素可以多个非block元素共占一行,设置的height和width无效!block:块元素独占一行,可以设置height,widthinline-block:是上面的结合,height和width起作用 ,默认以元素底部对齐,可以使用vertical-align:top改成顶部对齐inline-table:用于table元素,table默认和block元素...原创 2019-06-19 17:58:47 · 485 阅读 · 0 评论