padding

CSS核心内容整理

╄→尐↘猪︶ㄣ 提交于 2019-12-06 09:45:59
本文是CSS核心内容整理的第二篇,承接上一篇的内容继续对CSS的一些重要内容进行整理,推荐先看完这个系列的上一篇. 四. 页面布局 布局可以说是我认为CSS中最重要的东西,CSS本身是个奇怪的东西一直以来有点游离于Coder和非Coder之间的感觉.本身没有严谨的逻辑,而且有很多奇怪的"习惯",这些在布局中都有所体现. 1. 基本布局概念 在布局上高度的用处在于细节和内容,整体是由宽度决定的. 首先从多栏布局开始划分,基本上有3种实现方案:固定宽度 、 流动、弹性. 固定宽度: 固定宽度的含义我就不解释了,我记得我几年前上大学的时候就有很流行的960Grid布局框架,通常固定布局的大小事900到1100,常用的是960因为基本上所有显示器都满足,同时960可以被16,12,10,8,6,5,4整除,易于分栏. 流动布局: 大小会随用户调整浏览器窗口大小而变化.当页面宽度变化的时候,文本和元素间的位置都可能变化.强调一下,有些童鞋以为流动布局就是响应式设计,这是不一样的.通过CSS媒体查询,适应各种宽度的可变固定布局才叫响应式设计,这和流动布局是不一样的. 弹性布局: 估计见过的人不多,效果比较类似于浏览器的放大和缩放功能,比如当浏览器窗口变宽了,那么里面的所有元素都按照一定比例大小变化.这个由于过于复杂,所以实际应用的例子不多. 2. 宽高是完全不一样的

Android第三十二天

北城以北 提交于 2019-12-06 09:20:37
1、什么是View? <1>所有高级UI组件都继承View类而实现的; <2>一个View在屏幕上占据一块矩形区域; <3>负责渲染; <4>负责处理发生的事件; <5>设置是否可见; <6>设置是否可以获得焦点等 2、LinearLayout、RelativeLayout和FrameLayout的联系和区别。 <1>FrameLayout 这个布局可以看成是墙脚堆东西,有一个四方的矩形的左上角墙脚,我们放了第一个东西,要再放一个,那就在放在原来放的位置的上面,这样依次的放,会盖住原来的东西。这个布局比较简单,也只能放一点比较简单的东西。 <2>LinearLayout 线性布局,这个东西,从外框上可以理解为一个div,他首先是一个一个从上往下罗列在屏幕上。每一LinearLayout里面又可分为垂直布局 (android:orientation="vertical")和水平布局(android:orientation="horizontal" )。当垂直布局时,每一行就只有一个元素,多个元素依次垂直往下;水平布局时,只有一行,每一个元素依次向右排列。 linearLayout中有一个重要的属性 android:layout_weight="1",这个weight在垂直布局时,代表行距;水平的时候代表列宽;weight值越大就越大。 <3>RelativeLayout

Masonry技巧汇总

我怕爱的太早我们不能终老 提交于 2019-12-06 08:46:04
Masonry debug 出现错误的地方,加入key就可以在冲突的时候输出相应的信息。 MASAttachKeys(greenView, redView, blueView, superview); [blueView mas_makeConstraints:^(MASConstraintMaker *make) { //you can also attach debug keys to constaints make.edges.equalTo(@1).key(@"ConflictingConstraint"); //composite constraint keys will be indexed make.height.greaterThanOrEqualTo(@5000).key(@"ConstantConstraint"); make.top.equalTo(greenView.mas_bottom).offset(padding); make.left.equalTo(superview.mas_left).offset(padding); make.bottom.equalTo(superview.mas_bottom).offset(-padding).key(@"BottomConstraint"); make.right.equalTo(superview

How to fill a MemoryStream with 0xFF bytes?

安稳与你 提交于 2019-12-06 07:55:24
I have a MemoryStream which is created from a File at runtime. Then the MemoryStream is edited and some bytes are removed. Now I have to maintain a Constant Filesize so I have to fill the MemoryStream with 0xFF bytes.. What is the Fastest way to Do this Operation? I know, that I always can loop through the MemoryStream sizes and add 0xFF's but I need to know a faster and more efficient way to do it! If you have many bytes to write to the stream, it may be more efficient to write a array rather than each byte individually: static void Fill(this Stream stream, byte value, int count) { var buffer

Extra padding in select option element in chrome

只愿长相守 提交于 2019-12-06 07:21:29
I have a select element where I enable users to choose the classification and description. In chrome browser only, I have an extra padding which I am not able remove with padding:0 or with other css tags. Screen from Chrome However, the same element in other browsers does not have any padding. See example screen from firefox. Screen from Firefox Any idea why this can be the case? Thank you This may help reset all the browser-specific styling for select elements: -webkit-appearance:none; -moz-appearance:none; appearance:none; UPDATE #2 Based on my own experience, and those of users on the

项目一总结 滚动监听

依然范特西╮ 提交于 2019-12-06 06:51:55
重点css3的动画效果 (时间及偏移位置)设置 和滚动监听位置的选择 HTML <!-- section1 --> <div class="section1"> <ul class=""> <li class="tt t1"><span class="cent1">骁龙855旗舰处理器</span><span class="cent2">年度超旗舰处理器</span></li> <li class="tt t2 "><span class="cent1">索尼 4800 万像素三摄</span><span class="cent2">DxOMark拍照评分领先</span></li> <li class="tt t3 "><span class="cent1">支持超广角、微距拍摄</span><span class="cent2">开启手机摄影非凡视野</span></li> <li class="tt t4"><span class="cent1">小米首款20W无线闪充</span><span class="cent2">速度堪比有线快充</span></li> <li class="tt t5"><span class="cent1">全息幻彩玻璃机身</span><span class="cent2">手心中的梦幻彩虹光</span></li> <li class="tt

文档流&文字&CSS常用命令

拥有回忆 提交于 2019-12-06 06:28:29
文档流 文档流就是文档内元素 流动 方向 流动方向 内联元素从左往右流 ,宽度不够,之字形,且元素会被截断 块元素从上往下流动 ,一排一排 注意事项 内联元素中有英文单词,流动时宽度不够,英文单词会整体迁移,不会被打断 若想打断上述联结,请使用css属性 /*想打断的内联元素*/{ word-break: break-all; display: inline-block; } 脱离文档流 类似悬浮在页面上一样 position: fixed; position: absolute; 关于字体 一般,页面默认字体大小 16px 字体一般都分为 上部 、 中部 、 下部 文字(汉字、西文)都相对基线(下部)对齐 不同字体有自己规定的建议行高,可以自行 line-height 规定 CSS常用命令 字体相关 设定字体样式 /*各类选择器*/{ font-family: kai; } 字体加粗 /*各类选择器*/{ font-weight: bold; } 字体大写 /*各类选择器*/{ text-transform: uppercase; } 背景相关 背景位置与自适应 /*各类选择器*/{ background-position: center center;/*水平方向*/ /*垂直方向*/ background-size: cover;/*背景自适应*/ background:

less用法

余生颓废 提交于 2019-12-06 04:48:35
LESS的基本用法 什么是LESS: LESS是一个动态样式语言,属于CSS预处理语言的一种,为CSS的赋予了动态语言的特性,如变量、继承、运算、函数等,更方便CSS的编写和维护,让CSS更具有维护性,主题性,扩展性。 LESS可以在多种语言、环境中使用,包括浏览器端、桌面客户端、服务端。 LESS的官方网站: www.lesscss.org 如何使用LESS: 在使用时,应当用编译工具进行编译后使用! 使用的编译工具: Koala 官网下载: koala-app.com LESS文件中的注释: 1、//注释的内容 只会在less文件中显示,不会编译到css文件中去; 2、/ *注释的内容 */ 会被编译到css文件中去; LESS中的变量 普通变量 定义方式:@变量名:变量值 @green: #801f77; @baise:white; 作为选择器和属性名 定义方式:@{ 变量名 } @kuandu:width; .@{kuandu}{ @{kuandu}:150px } 作为URL 使用方式:用" "将变量的值扩起来,同样将变量以 @{ 变量名 } 的方式使用 @imgurl:"https://www.baidu.com/img/"; header{ background: @green url("@{imgurl}bdlogo.png"); height: 500px; }

css 图片切换模版

僤鯓⒐⒋嵵緔 提交于 2019-12-06 04:38:00
(1)淘宝网4种JS图片切换幻灯焦点图代码 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> < html xmlns = "http://www.w3.org/1999/xhtml" > < head > < meta http-equiv = "Content-Type" content = "text/html; charset=utf-8" /> < title > 焦点图 </ title > < style type = "text/css" > body { margin : 0px ; padding : 0px ; background : url (/jscss/demoimg/201109/bg.jpg);} ul , li { margin : 0px ; padding : 0px ; float :left; list-style-type :none;} .frame { width : 1010px ; height :auto; overflow :hidden; margin : 40px auto 0 auto;} .box { width :

博客园自定义博客签名

北城余情 提交于 2019-12-06 04:33:13
一、添加博客签名 管理--》操作---》博客签名---》新建签名 <div><p>作者:<a href="https://www.cnblogs.com/yanl55555/" target="_blank">哒哒Da</a></p></div> <div><p>出处:<a href="https://www.cnblogs.com/yanl55555/" target="_blank">https://www.cnblogs.com/yanl55555/</a></p></div> <div><p>本博客所有文章仅用于学习、研究和交流目的,欢迎非商业性质转载。</p> <p>博主的文章没有高度、深度和广度,只是凑字数。由于博主的水平不高,不足和错误之处在所难免,希望大家能够批评指出。</p> <p>博主是利用读书、参考、引用、抄袭、复制和粘贴等多种方式打造成自己的文章,请原谅博主成为一个无耻的文档搬运工! </p> </div> 二、设置样式 管理--》设置--》页面定制css代码 #MySignature{   border:solid 1px #E5E5E5; padding:10px; background:#E5EEF7 url(http://images.cnblogs.com/cnblogs_com/grenet/226272/o_o_o_info.png) no