padding

浮动与定位

微笑、不失礼 提交于 2019-11-29 16:55:00
  浮动与定位在网页设计中应用得很广泛,是两种主要布局方式的实现方法。   我们知道,网页上一般来说,块标签是自上而下的一块块堆叠,行内标签则在一行内从左到右依次并排,如果所有网页的都这样机械的排列着,也太单调了,所以有没有一个东西让标签内容脱离这种文档流呢,首先就可以考虑float。   float,使某元素浮动起来,可以把元素移到,比如浏览器边沿的左边或右边,看上去它们就像粘在边沿上一样,它下边的文本则会充斥在它的一边或者下面,如下例 <!DOCTYPE html> <html> <head> <title>float test</title> <style type="text/css"> /*reset*/ body,div,p,a,ul,li,h1,h2,h3,h4,h5,h6,pre,img{margin:0;padding:0;} .wrap{ width:300px; margin:0 auto; border:2px solid #30c13a; } .wrap .fl{ width:100px; float:left; background-color:#8cceff; } </style> </head> <body> <div class="wrap"> <p class="fl"> The Macintosh Classic is a personal <

Relative padding is relative to what?

烈酒焚心 提交于 2019-11-29 16:53:18
问题 If I style an <h1> element with padding: 1.2em or padding: 10% , is that relative to the: font-size of the <h1> element? height of the <h1> element? padding of the parent element? something else? And is it different for em and % ? 回答1: It is indeed different for em and % : Ems The padding size is relative to the calculated font size of that element . So, if your <h1> ’s calculated font size is 16px, then 1.2 ems of padding = 1.2 × 16 pixels = 19.2 pixels. Percentages The padding size is

JavaScript/JQuery 宽高的理解和应用

一笑奈何 提交于 2019-11-29 16:45:33
以下为个人认为有必要记录的笔记 不喜勿喷 js相关宽高介绍 window对象和document对象的介绍 window对象和document对象的location属性 与 window对象相关的宽高: window对象的 screen属性 与 document 相关的宽高: document对象中与 client 相关的宽高 document对象中与 offset 相关的宽高 document对象中与 scroll 相关的宽高 documentElement和body的关系 Event对象的各种坐标 clientX,clientY screenX,screenY offsetX,offsetY pageX,pageY X,Y js各种宽高的应用 可视区域加载 网页滚动到底部或者顶部的加载 div滚动到底部的加载 jq相关宽高介绍 内容宽高: 内容+padding宽高 内容+padding+border宽高 其他宽高相关 .scrollLeft() .scrollTop() .offset() .position() js相关宽高介绍 window对象和document对象的介绍 window对象 表示浏览器中打开的窗口。 可以省略。 document对象 是window对象的一部分。 window对象去掉浏览器上部的菜单栏。 HTML文档成为 document 的对象。

CSS

旧街凉风 提交于 2019-11-29 16:41:52
1.CSS介绍 CSS是Cascading Style Sheets的简称,中文称为层叠样式表,对html标签的渲染和布局 CSS 规则由两个主要的部分构成:选择器,以及一条或多条声明 2.CSS语法 实例 注释 /*这是注释*/ 在写css样式的时候要写一个 body{ margin:0; } 意思是说,body的上下左右的margin都设置为0 在下面会将为什么 3.CSS的集中引入方式 3.1行内式 行内式是在标记的style属性中设定CSS样式。不推荐大规模使用。 <p style="color: red">Hello world.</p> 3.2.内嵌式 嵌入式是将CSS样式集中写在网页的<head></head>标签对的<style></style>标签对中。格式如下: <head> <meta charset="UTF-8"> <title>Title</title> <style> p{ background-color: #2b99ff; } </style> </head> 3.3链接式* 外部样式就是将css写在一个单独的文件中,然后在页面进行引入即可。 推荐 使用此方式。 <link href="mystyle.css" rel="stylesheet" type="text/css"/> #现在写的这个.css文件是和你的html是一个目录下

前端聊天工具

不羁岁月 提交于 2019-11-29 16:33:55
简单的前端客服聊天 html <!doctype html> <html> <head> <meta charset="utf-8"> <title>客服聊天</title> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> <meta name="format-detection" content="telephone=no"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <link rel="stylesheet" href="../layui-src/dist/css/layui.css" /> <script src="../js/library/hio.js"></script> <style> /*公共样式*/ html{font-family:"Helvetica Neue",Helvetica,STHeiTi,sans-serif;-webkit-text

Border and Padding width javascript

Deadly 提交于 2019-11-29 16:31:00
UPDATE: Edited javascript code. It's only slightly off now in some columns. Maybe a pixel or two. Not sure why. I need to get the border and internal padding width of a cell of a table. I plan to subtract these values from the offsetWidth to get the content width, and use that to set the style.width of another cell. Unfortunately, I can't find a tried-and-true way to get the border and padding width. Anyone got an idea? UPDATE: I added the code below to show my implementation. It still doesn't align correctly. I'm attempting to sync up column widths of the two tables; however, the table widths

手机移动端confirm替换方案

大憨熊 提交于 2019-11-29 16:24:48
//弹框 ;(function () { var ConfirmBox = function (options){ this.defaults = { title:"", topT:"提示", btnOk:"确定", btnNo:"取消", btnConfirm:"", callback:null }, this.options = $.extend({}, this.defaults, options); }; ConfirmBox.prototype = { constructor: ConfirmBox, boxOpen:function(){ var teml = ""; teml=teml+'<div id="opp">'; teml=teml+'<div class="opBox js-opBox">'; teml=teml+' <div class="opBoxHead"><i class="icon f16">x</i> '+this.options.topT+'</div>'; teml=teml+' <div class="opBoxCont">'; teml=teml+' <p id="#msgC">'+this.options.title+'</p>'; teml=teml+' </div>'; teml=teml+' <div class=

两栏布局,三栏布局,等高布局,流式布局

北慕城南 提交于 2019-11-29 16:23:08
读前笑一笑: 我前面一女生平胸,然后我问她哪天你晚上自己回家,被劫色怎么办…? 她淡淡的回了句:“我就脱了上衣,然后说,别激动,是自己人”……自己人……己人…人… 两栏布局: 1. float+margin(一侧定宽,一侧自动) <!DOCTYPE HTML> <html> <head> <meta charset="UTF-8"> <title> 左定宽,右自动 </title> <style type="text/css"> html,body{margin:0; padding: 0;} .m-box .left,.m-box .right { height: 200px; line-height:200px; text-align:center; } .m-box .left{float:left; width:200px; background-color:#ccc; } .m-box .right{margin-left:210px; background-color:#666;} </style> </head> <body> <div class="m-box"> <div class="left">左</div> <div class="right">右</div> </div> </body> </html> View Code 2.position

Padding values on inverted axis in jqplot

安稳与你 提交于 2019-11-29 15:59:51
i would like to know how to set the correct padding values to a jqplot axis so that points aren't rendered on the borders. this is the code i have yaxis:{ max: 1, min: 200, numberTicks: 5, tickOptions:{ formatString:'%i' } } this displays an inverted axis going from 200 on the bottom to 1 on the top. values vary also from 1 to 200. i have tried with maxPad, minPad and even setting the ticks manually with ( ticks: ['200','150','100','50','1'] ) but no luck so far. thanks in advance :) That was interesting and relaxing at the same time. The answer to your problem is obvious, since the padding

css007 margin padding border

守給你的承諾、 提交于 2019-11-29 15:48:16
css007 margin padding border 1、理解盒模型 (盒模型:就是把一些东西,包括html各种标签都包含在一个 看不见的盒子里) 1/在web浏览器中任何标签都是一个盒子,内容的周围环绕着装饰盒子的不同属性 Pad ding:内容和其框线之间的距离 Margin:一个标签和另一个标签之间的距离 Border:盒子周边的直线 Background-color:填充边框内部空间的间隔 2、用margin和padding控制空间 (margin控制盒子外部和其他元素之间的空间; padding控制盒子里面内容到盒子的距离,在一般浏览器都会有默认的行距或者各种缩进距离。一般要用margin和padding清零。Margin和padding后面可以跟1到4个值,如果是两个值的话,分别代表上下 和 左右。一般的顺序是:上右下左(顺序一定不能搞乱了)。可以指定方向,比如margin-top) 1、margin和padding都是在内容的周围添加空间。 2、边距冲突:当margin-bottom 遇到(冲突)下面一个元素的margin-top时,浏览器是应用他们之间比较大的那个(只应用一个,不是两个相加) 3、可以用margin的负值消除不必要的空隙(margin是比较少数可以用负值的一个css属性。Padding一定要用正值) 4、行内盒子,块级盒子及其其他显示设置