padding

CSS。盒子,内外(未整理)

混江龙づ霸主 提交于 2019-11-27 13:19:33
CSS 间距   内边距:元素距离元素内部的间离 <div>你好</div> -------------------------- <style>   div{     width:200px;     height:200px;     background:red;     padding-top:22px;   文字距离顶部产生距离     padding-left:30px     文字距离左侧边框有距离     } </style>   注意:padding会改变元素的实际大小,   可以直接padding:30px 30px 39px 30px 。改变元素大小,对应是上,右,下,左。顺时针方向。       padding:22px 33px。两个元素时候,第一个元素代表上下对边。第二个代表左右对边。       padding:30px。一个元素的时候,代表四边都是30px。   外间距:元素距离周围元素的间距 <div class= “ggg”></div> <div class= “hhh”></div> -----------------------让ggg和hhh的上下相隔20px <style>   div{     width:200px;     height:200px;     .ggg{                   background

padding a text input in IE… possible?

寵の児 提交于 2019-11-27 12:54:42
问题 I have a text input with a search buton absolute positioned over it... to make space for the button I used some padding to keep the text from going under the button, which is fine, it works in firefox, but not IE. In fact... It doesn't seem like padding on text inputs works at all in IE. They have the following code <style type="text/css"> #mainPageSearch input { width: 162px; padding: 2px 20px 2px 2px; margin: 0; font-size: 12px; -moz-border-radius: 5px; -webkit-border-radius: 5px;

动画原理——指针随鼠标旋转动画

孤者浪人 提交于 2019-11-27 12:30:59
书籍名称:HTML5-Animation-with-JavaScript 书籍源码:https://github.com/lamberta/html5-animation 1.window.requestAnimationFrame 一般显示器的刷新频率为16.7ms,简单的使用setTimeout(fn,10)会导致在每第三次渲染的时候正好显示器在刷新,这次渲染就会丢失。 requestAnimationFrame应用可与浏览器的绘制时间间隔保持完全一致,并且仅使用适量的资源,要实现持续的动画,请在调用动画函数后再次调用 requestAnimationFrame。 简单可以理解为 setTimeout(fn,17); /* 1000/60 */ 2.根据鼠标的位置获取指针的角度。 注意:在我们常规的数学坐标系,逆时针的角度为正,而cavas中顺时针为正。 所以这里的dy是mouse.y-arrow.y,角度负向,这个dy值为负。 如图我们可以看出,当我们知道dy和dx时,通过js中中的Math.actan2(dy,dx)我们可以得到弧度 . 3.指针随鼠标旋转动画代码,自行读取调试,文章开头提供了书籍名称,和源码链接 index.html, <!doctype html> <html> <head> <meta charset="utf-8"> <title>Rotate to

几种网络LeNet、VGG Net、ResNet原理及PyTorch实现

早过忘川 提交于 2019-11-27 12:30:24
LeNet比较经典,就从LeNet开始,其PyTorch实现比较简单,通过LeNet为基础引出下面的VGG-Net和ResNet。 LeNet LeNet比较经典的一张图如下图 LeNet-5共有7层,不包含输入,每层都包含可训练参数;每个层有多个Feature Map,每个FeatureMap通过一种卷积滤波器提取输入的一种特征,然后每个FeatureMap有多个神经元。 1.INPUT层-输入层 输入图像的尺寸统一归一化为: 32 x 32。 2.C1层 卷积层 输入图片:32 x 32 卷积核大小:5 x 5 卷积核种类:6 输出featuremap大小:28 x 28 (32-5+1)=28 神经元数量:28 x 28 x 6 可训练参数:(5 x 5+1) x 6(每个滤波器5 x 5=25个unit参数和一个bias参数,一共6个滤波器) 连接数:(5 x 5+1) x 6 x 28 x 28=122304 3.S2层 池化层(下采样层) 输入:28 x 28 采样区域:2 x 2 采样方式:4个输入相加,乘以一个可训练参数,再加上一个可训练偏置。结果通过sigmoid 采样种类:6 输出featureMap大小:14 x14(28/2) 神经元数量:14 x 14 x 6 可训练参数:2 x 6(和的权+偏置) 连接数:(2 x 2+1) x 6 x 14 x 14

Google Maps API 3 fitBounds padding - ensure markers are not obscured by overlaid controls

吃可爱长大的小学妹 提交于 2019-11-27 12:23:06
I'd like to be able add padding to a map view after calling a map.fitBounds() , so all markers can be visible regardless of map controls or things like sliding panels that would cover markers when opened. Leaftlet has an option to add padding to fitBounds , but Google Maps does not. Sometimes the northmost markers partially hide above the viewport. The westmost markers also often lay under the zoom slider. With API 2 it was possible to form a virtual viewport by reducing given paddings from the map viewport and then call the method showBounds() to calculate and perform zooming and centering

Encrypt in PHP openssl and decrypt in javascript CryptoJS

浪子不回头ぞ 提交于 2019-11-27 12:13:51
I'm encrypting some parameters in PHP using openssl("parameter", "AES-256-ECB", "client") and I wish to decrypt in CryptoJS : CryptoJS.AES.decrypt(parameter, "client", {mode: CryptoJS.mode.ECB}).toString(CryptoJS.enc.Utf8); but it's throwing an empty string. Any suggestions? CryptoJS: PHP openssl encrypt -> javascript decrypt PHP: function CryptoJSAesEncrypt($passphrase, $plain_text){ $salt = openssl_random_pseudo_bytes(256); $iv = openssl_random_pseudo_bytes(16); //on PHP7 can use random_bytes() istead openssl_random_pseudo_bytes() //or PHP5x see : https://github.com/paragonie/random_compat

How to append to AES encrypted file

旧时模样 提交于 2019-11-27 12:13:02
I'm writing some kind of logger that produces encrypted log-file. Unfortunately, cryptography is not my strong side. Now I can write to file several messages and then close file. Then i can open it, append some messages, close again and after decryption I see padding bytes in the middle of file. Is there any way to work with encrypted file without having to decrypt it every time I want to append some messages? EDIT : little more details. Current implementation utlizes CipherOutputStream. As i understand there's no way to seek using it. Can i use 'NoPadding' option if i will control that output

Space between div and img?

非 Y 不嫁゛ 提交于 2019-11-27 12:06:31
问题 I have code like this: <div id="sc"> <h1>1. Orange</h1> <p>some text in here </p> </div> <img class="separator" src="images/separator.png" /> There's ALWAYS 13px gap between the "sc" div and "separator" img. Margins and paddings for both are set to 0, null, empty, nothing. Argh. I'm so mad ;d I was trying to figure out what's going on with firebug but the space between them just doesn't belong to anything, it's not a margin, not a padding, what the heck? No floats, no display settings, no

How to adjust gutter in Bootstrap 3 grid system?

别说谁变了你拦得住时间么 提交于 2019-11-27 12:04:52
The new Bootstrap 3 grid system is great. It's more powerful for responsive design at all screen sizes, and much easier for nested. But I have one issue I could not figure out. How do I add precise gap between the columns? Say I have container 960px, 3 columns at 310px and 2 gutters at 15px in between 3 columns. How do I do that? You could create a CSS class for this and apply it to your columns. Since the gutter (spacing between columns) is controlled by padding in Bootstrap 3, adjust the padding accordingly: .col { padding-right:7px; padding-left:7px; } Demo: http://bootply.com/93473 EDIT If