margin

Margin/Padding Shrinks ImageView

為{幸葍}努か 提交于 2019-12-10 11:27:17
问题 I recently tried to position an imageview's x and y coordinates with no luck, it seems there is no way to do it in Gingerbread. I then decided to try out paddings and margins, but when I set them, it shrinks my imageview. I set a left padding of 250dp and image view became tiny. The layout_height and width are set to wrap_content. I'm not sure what's going on. Does anyone know why setting a padding/margin would shrink an imageview? 回答1: You're confusing margin and padding. Margin is the area

C#编程之串口(三)

不打扰是莪最后的温柔 提交于 2019-12-10 10:55:25
这一章我将继续上一章内容进一步完善我们的串口通信,并添加对话框的美观设计。 首先我们说一下双向通讯,上一章我们实现了单向接收功能,这里将说一下发射功能: 数据发送,总共有三种形式,发送字符串类,发送byte类,发送char类。要实现这三种,都必须调用串口写操作方法 SerialPort.Write() ,该方法对于不同类型的发送,通过方法重载的方式定义了相应的方法: public void Write ( string str); 发送字符串 public void Write ( byte [] buffer, int offset, int count); 发送byte类型 public void Write ( char [] buffer, int offset, int count); 发送char类型 本例程发送的是加密后的序列号码,所以只需调用 myPort.Write(output, 0 ,output.Length); 方法即可。此外我们添加一个清空按键: private void Btn2_Click(object sender, RoutedEventArgs e) { m_textBox1.Text = ""; m_textBox2.Text = ""; } <Button Content="Clear" HorizontalAlignment="Right

Fluid column layout with fixed pixel margins between them?

99封情书 提交于 2019-12-10 10:46:01
问题 I dont want to use JS for this, only a css solution please . I want the columns inside of a containing div to fit inside equally i.e each one is a third of the width of the container. I have achieved this here - http://jsfiddle.net/yFxZX/ However, on top of this, I also want 10px margin between the columns, with the first column kissing the left edge of the container, and the right column kissing the right edge of the container. see image below for crude mock up. As the browser is re-sized or

---CSS3绘制8种超炫的加载动画

泄露秘密 提交于 2019-12-10 09:48:45
CSS3绘制8种超炫的加载动画 逛前端开发网站的时候,偶尔发现一组非常炫酷的CSS3加载动画,遂迫不及待的做个Demo保存下来。 这些加载动画用到了CSS3的旋转transform属性,颜色透明度设置和伪元素操作等CSS技术。奇妙的组合,产生了意想不到的效果。 1.上下起伏波动的加载动画: #loader1, #loader1:before, #loader1:after { background: #f2fa08; -webkit-animation: load1 1s infinite ease-in-out; animation: load1 1s infinite ease-in-out; width: 1em; height: 4em; } #loader1:before, #loader1:after { position: absolute; top: 0; content: ''; } #loader1:before { left: -1.5em; } #loader1 { text-indent: -9999em; margin: 50px 50px; position: relative; float: left; font-size: 11px; -webkit-animation-delay: 0.16s; animation-delay: 0.16s; }

图片轮播css实现

假如想象 提交于 2019-12-10 07:44:52
html 部分 <div class="csslider1 autoplay"> <input name="cs_anchor1" autocomplete="off" id="cs_slide1_0" type="radio" class="cs_anchor slide" > <input name="cs_anchor1" autocomplete="off" id="cs_slide1_1" type="radio" class="cs_anchor slide" > <input name="cs_anchor1" autocomplete="off" id="cs_slide1_2" type="radio" class="cs_anchor slide" > <input name="cs_anchor1" autocomplete="off" id="cs_play1" type="radio" class="cs_anchor" checked> <input name="cs_anchor1" autocomplete="off" id="cs_pause1" type="radio" class="cs_anchor" > <ul> <div style="width: 100%; visibility: hidden; font-size: 0px;

BFC与IFC

て烟熏妆下的殇ゞ 提交于 2019-12-10 05:21:28
BFC与IFC 在我们做的网页上通常最重要的其中一点就是美观度,bfc他是一个块级格式化上下文,它是一个独立的渲染区域,只有Block-level box参与, 它规定了内部的Block-level Box如何布局,并且与这个区域外部毫不相干。 因为我现在天天在做网页了,之前没怎么关注bfc与ifc原理,以至于我做出来的网页有点偏差。所以要深刻学习以下知识。 bfc:指它里面的子元素不会影响到外面的元素 加上一个overflow:hilden该元素的子元素是一个bfc下面 只要触发的是个bfc那么它对外面都没有影响。 1.block-level box:display 属性为 block, list-item, table 的元素,会生成 block-level box。并且参与 block fomatting context; 2.inline-level box:display 属性为 inline, inline-block, inline-table 的元素,会生成 inline-level box。并且参与 inline formatting context; 块级元素,在浏览器中通常是垂直布局,然后可以用margin来控制块级元素之间的间距,并列和嵌套的块级元素都存在外边距,也就是margin合并的问题。 而行内元素是以水平的方式布局,垂直方向的margin

如何让div水平垂直居中

空扰寡人 提交于 2019-12-10 04:28:50
如何让div水平垂直居中 @(css)[妙瞳] 引子 我们经常遇到需要把div中的内容进行水平和垂直居中。所以,这里介绍一种方法,可以使div水平居中和垂直居中。 代码: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>div水平垂直居中</title> <style> *{ margin:0; padding:0; } div.box{ background-color:pink; border:2px solid #000; width:960px; height:500px; margin-left:50px; } </style> </head> <body> <div class="box"> <img src="girl.jpg" alt="美女"> </div> </body> </html> 效果图: 现在先让图片在div中水平居中 我们可以先给图片套一层盒子。 代码: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>div水平垂直居中</title> <style type="text/css"> *{ margin:0; padding:0; } div.container{

Zxing 二维码的生成,素材,logo的添加

点点圈 提交于 2019-12-10 04:01:46
前不久接到一个二维码的生成工作,要求生成的二维码添加指定的背景图和logo,在网上找了一些资料,用了zxing3.0的jar包,成功解决问题,现在和大家分享一下; import java.awt.BasicStroke; import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Image; import java.awt.Shape; import java.awt.geom.RoundRectangle2D; import java.awt.image.BufferedImage; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.net.URL; import java.util.Hashtable; import javax.imageio.ImageIO; import com.google.zxing.BarcodeFormat; import com.google.zxing.EncodeHintType; import com.google

Auto-growing margins when screen width get stretched

*爱你&永不变心* 提交于 2019-12-10 02:25:24
问题 I have a list ( <ul /> ) that I try to display as a grid. The cells have a fixed width (let's say 100px): the number of cols and rows depends then on the screen resolution. When the screen has a large width, there are many columns but few lines: ______________________________________________________________ | ___________ ___________ ___________ ___________ | | | | | | | | | | | | | #1 | | #2 | | #3 | | #4 | | | |<- 100px ->| |<- 100px ->| |<- 100px ->| |<- 100px ->| | | | | | | | | | | | | |_

CSS 5种很炫的Hover效果。跳,放大,旋转,淡入,悬浮

混江龙づ霸主 提交于 2019-12-10 02:20:57
给平淡的站点带来活力 hover效果能给网页增加一些动态效果,并且使得站点更具有活力。原来的做法是使用javascript来实现这些动态效果,但是随着CSS3的引入和现代浏览器的支持,我们可以用纯粹的CSS代码来实现这些有趣的效果。所谓的现代浏览器,更多的是指以Mozilla和Webkit为核心的浏览器,IE的表现稍微差强人意,所以请使用FireFox,Safari或者Chrome查看一下的效果。如下就是要介绍的5个非常酷的纯CSS hover 效果。 向上跳跃 这种效果非常适合于当页面上有一横排图片的场景,当鼠标hover时就产生波浪一样的效果。 这个效果实现是非常简单的,并且有多种方法实现,如下的核心实现方法是:初始给所有图片设置mergin,当hover时,给相应的图片减少mergin的值,这样就实现了向上跳跃的效果。 这种效果不光可以应用于图片,一般的横向排列的导航栏也可以应用这样的效果。 效果中的透明效果是并不是必须的,不设置透明属性并不影响hover时的跳跃效果,加上透明只是为了让效果更平滑。 CSS代码: .ex1 img{ border: 5px solid #ccc; float: left; margin: 15px; -webkit-transition: margin 0.5s ease-out; -moz-transition: margin 0.5s