padding

CSS记录(简单)

安稳与你 提交于 2019-11-30 21:59:21
ID选择器:#id { } ID是独一无二的,不可重复 类选择器: .class { } 标签选择器 子选择器:.food>li 大于符号(>),仅用于选择指定标签元素的第一代子元素 后代选择器:.food li 通用选择器:*{ } 匹配html中所有标签元素 伪类选择符:例:a:hover{color:red;}->鼠标滑过状态设置字体颜色变红 分组选择符:h1,span,li { } 标签的权值为1,类选择符的权值为10,ID选择符的权值最高为100 (相同权重值时): 层叠就是在html文件中对于同一个元素可以有多个css样式存在, 当有相同权重的样式存在时,会根据这些css样式的前后顺序来决定, 处于最后面的css样式会被应用。 优先级:内联样式表(标签内部)> 嵌入样式表(当前文件中)> 外部样式表(外部文件中) 改变样式权重:!important >> p{color:red!important;} 文字: font-family:" "; /*设置字体*/ font-size:6px;/*设置文字字号*/ color:red;/*设置文字颜色*/ font-weight:bold;/*设置字体加粗*/ font-style:italic/*斜体*/ text-decoration:underline;/*设置文字下划线*/ text-indent:2em;/*缩进*

CSS-盒模型

蓝咒 提交于 2019-11-30 21:21:55
在这张图中,我们发现我们设置的300*400出现在了最里面的那个蓝框中,与此同时我们可以发现在这个盒模型中除了我们设置的内容(content),还有margin(外边距)、border(边框)、padding(内边框) margin(外边距) - 清除边框外的区域,外边距是透明的。 border(边框) - 围绕在内边距和内容外的边框。 padding(内边距) - 清除内容周围的区域,内边距是透明的。 content(内容) - 盒子的内容,显示文本和图像。 为了正确设置元素在所有浏览器中的宽度和高度,你需要知道盒模型是如何工作的。 而我们在测试效果图看到的350*450盒子, 350(width) = 300(content) + 20(padding)* 2 + 5(border)* 2 450(height)= 400 (content)+ 20(padding)* 2 + 5(border)* 2 css的两种盒模型 而引起上面效果的原因来自于 css 的两种盒模型的不同,这里我先对两种盒模型做个介绍。 W3C的标准盒模型 在标准的盒子模型中,width指content部分的宽度 IE的盒模型 在IE盒子模型中,width表示content+padding+border这三个部分的宽度 我们可以看出我们上面的使用的默认正是W3C标准盒模型

How can I remove all default padding from EditText?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 18:46:31
I am using an EditText and it always adds a bit of padding in my text to both left and right. Adding android:includeFontPadding="false" did not help and using negative android:layout_marginLeft or android:layout_marginRight just makes the EditText "expand". How can I strip all padding from the EditText that is being added by default? <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="20dp" android:fontFamily="roboto-regular" android:layout_gravity="center_vertical" android:gravity="center_vertical" android:layout_marginLeft="-5dp" android

pad varchar numbers with 0s in db2

 ̄綄美尐妖づ 提交于 2019-11-30 18:25:16
Is there a way to pad 0s before numbers stored as VARCHAR in DB2? Like this: some_column result ----------- ------ 12 ==> 00012 123 ==> 00123 6454 ==> 06454 If the function LPAD is available: SELECT LPAD(some_column, 5, '0') FROM table Otherwise you can use a combination of RIGHT and REPEAT : SELECT RIGHT(REPEAT('0', 5) || some_column, 5) FROM table some_column | Concatenate five '0's to some_column | Return the five rightmost characters ------------------------------------------------------------------------ 12 => 0000012 => 00012 123 => 00000123 => 00123 6454 => 000006454 => 06454 来源: https:

How can I add blank space to the end of a ListView?

不羁的心 提交于 2019-11-30 17:34:54
I have a number of elements in a ListView that scroll off the screen. I would like there to be blank space at the end of the View. That is, the user should be able to scroll past the last element such that the last element is in the middle of the viewport. I could use an OverScroller , but I think that would only enable the View to have a bouncy effect like one often sees on the iPhone. Is there something I might have overlooked? The scrolled-to-the-botton screen should look something like this: Inflate any layout of your choice (this could be an XML of and ImageView with no drawable and with

Padding-top not working

ぐ巨炮叔叔 提交于 2019-11-30 17:03:31
Why doesn't padding-top work? The height of the div is set. HTML: <div class="menu"> <a href="#">APIE MUS</a> <a href="#">REKLAMA</a> <a href="#">PARTNERIAI</a> </div> CSS: .menu { width: 300px; height: 30px; background: red; } .menu a { padding-top: 10px; } Your example (with margin) does not work because you can't apply margin to inline elements like a, span, b . Take a look: http://www.webdesignfromscratch.com/html-css/css-block-and-inline/ http://webdesign.about.com/od/htmltags/qt/block_vs_inline_elements.htm To fix your issue: Just add display:inline-block; This value (inline-block)

Android TextView drawable, change padding between drawable and text?

自作多情 提交于 2019-11-30 16:46:57
I am creating a TextView with a drawable underneath, in a GridLayout . I want to bring the drawable to the middle of the TextView ; I tried with setCompoundDrawablePadding(-75) and it only changes the position of the text. Current code: TextView secondItem = new TextView(this); GridLayout.LayoutParams second = new GridLayout.LayoutParams(row2, col1); second.width = halfOfScreenWidth; second.height = (int) (quarterScreenWidth * 1.5); secondItem.setLayoutParams(second); secondItem.setBackgroundResource(R.color.MenuSecond); secondItem.setCompoundDrawablesRelativeWithIntrinsicBounds(0, 0, 0, R

内联元素的padding,margin,border等不起作用

…衆ロ難τιáo~ 提交于 2019-11-30 16:05:09
关于内联元素的 上下padding,margin,border ,它们并不是没有作用,而是不会影响元素的 line-height,也不会影响其他相邻的元素,上下padding(或者margin,border)设得再大,它的 line-height 是不变的,所以高度上就看不出什么效果,但是设置元素的背景颜色可看出效果,如下面的代码 [HTML] 纯文本查看 复制代码 ? 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 <!DOCTYPE html> < html lang = "en" > < head > < meta charset = "UTF-8" > < title >Title</ title > < style > span{ padding:30px; background:gray; opacity:0.8; } </ style > </ head > < body > < div style = "width:300px;height:300px;" >哈哈哈哈哈哈哈哈哈哈哈哈哈< span >span测试</ span > 哈哈哈哈哈哈哈哈哈哈哈哈哈 </ div > </ body > </ html > 可以看出padding上下左右都变大了(从背景中可以很明显的看出)

When are pad bytes copied - struct assignment, pass by value, other?

泄露秘密 提交于 2019-11-30 15:51:27
While debugging a problem, the following issue came up. (Please ignore minor code errors; the code is just for illustration.) The following struct is defined: typedef struct box_t { uint32_t x; uint16_t y; } box_t; Instances of this struct are being passed by value from function to function (obviously simplified): void fun_a(box_t b) { ... use b ... } void fun_b(box_t bb) { // pass bb by value int err = funa(bb); } void fun_c(void) { box_t real_b; box_t some_b[10]; ... ... use real_b and some_b[] ... ... funb(real_b); funb(some_b[3]); ... box_t copy_b = some_b[5]; ... } In some cases, two

css样式

蹲街弑〆低调 提交于 2019-11-30 14:49:17
css样式 文字与文字样式:单位与颜色、text、font p{ font-size:12px; color:blue; font-weight:bold;} css样式常用单位: px; 像素 em:1em一个字符 行高(自动适应用户所使用的字体) %:百分比 1.颜色 red,blue,green 颜色名: http://www.w3school.com.cn/cssref/css colors legal.asp rgb(x,x,x) RGB值 每个颜色分量取值0-255 红色:rgb(255,0,0) 灰色:rgb(66,66,66) rgb(x%,x%,x%) RGB百分比值 0%-100% 红色:rgb(100%,0%,0%) rgba(x,x,x,x) RGB值,透明度 a值:0.0(完全透明)与1.0(完全不透明) 红色半透明:rgba(255,0,0,0.5) #rrggbb 十六进制数 红色:#ff0000 红色:#f00 去掉重复位 2.文本 color 文本颜色 red #f00 rgb(255,0,0) letter-spacing 字符间距 2px -3px line-height 行高 14px 1.5em 120% text-align 对齐 center left right justify text-decoration 装饰线 none