padding

我的博客园配置

≡放荡痞女 提交于 2020-01-23 02:40:02
CSS代码: /*公用*/ body { font-size:13px; padding:0; margin:0; font-family:"微软雅黑","宋体",Arial; background:#205424 url("https://www.cnblogs.com/images/cnblogs_com/carcar/1468123/o_18002.jpg") no-repeat top center fixed; background-size:100% 100%; min-width:1200px; } #home { opacity: 0.65; filter: alpha(opacity=95); box-shadow:0 0 10px #000; margin:40px auto; width:1200px; background:#fff; overflow:auto; border:solid 1px #fff; } /*段落*/ .postBody p,.postCon p { margin:7px 0; line-height:24px; } h1 { margin:0; } h3 { font-size:15px; font-weight:bold; } /*超链接*/ a { color:#464646; text-decoration:none; }

CSS margin与padding的区别

浪尽此生 提交于 2020-01-23 01:06:35
在CSS中margin是指从自身边框到另一个容器边框之间的距离,就是容器外距离。在CSS中padding是指自身边框到自身内部另一个容器边框之间的距离,就是容器内距离。 下面讲解 padding和margin常用的用法 一、padding 1、语法结构 (1)padding-left:10px; 左内边距 (2)padding-right:10px; 右内边距 (3)padding-top:10px; 上内边距 (4)padding-bottom:10px; 下内边距 (5)padding:10px; 四边统一内边距 (6)padding:10px 20px; 上下、左右内边距 (7)padding:10px 20px 30px; 上、左右、下内边距 (8)padding:10px 20px 30px 40px; 上、右、下、左内边距 2、可能取的值 (1)length 规定具体单位记的内边距长度 (2)% 基于父元素的宽度的内边距的长度 (3)auto 浏览器计算内边距 (4)inherit 规定应该从父元素继承内边距 3、浏览器兼容问题 (1)所有浏览器都支持padding属性 (2)任何版本IE都不支持属性值“inherit” 二、margin 1、语法结构 (1)margin-left:10px; 左外边距 (2)margin-right:10px; 右外边距 (3

【经典面试题】圣杯布局以及双飞翼布局原理

半城伤御伤魂 提交于 2020-01-22 17:38:01
什么是圣杯布局以及双飞翼布局 上图就是一个经典的圣杯布局和双飞翼布局的模型,即三列结构,左右两边定宽,中间自适应,能根据屏幕大小做响应。 实现方式 浮动(经典方式) 在介绍这种方式之前要先说一下margin设置负值的作用: margin-top / margin-left 设置负值会将元素拉入对应位置 可以看到,当margin-top负值增大时,元素也跟着上移了,margin-left同理,负值增大会左移,两者都会导致元素溢出视口 margin-right / margin-bottom 设置负值会让后续元素拉入 上图看到当margin-right增大时,元素本身不变,后续元素会跟过来并覆盖本元素,margin-bottom同理,负值增大时后续元素会上移并覆盖。 如何实现 先给出html结构,注意中间自适应的center元素放在最前面: <body> <div id="header">#header</div> <div id="container"> <div id="center" class="column">#center</div> <div id="left" class="column">#left</div> <div id="right" class="column">#right</div> </div> <div id="footer">#footer<

Use StringBuilder to pad String with blank spaces or other characters

烈酒焚心 提交于 2020-01-22 17:28:46
问题 I'm a beginner to java and this is my first post on Stackoverflow. Although my initial code is similar to other posts here, my question relates to implementing StringBuilder and so the reason for this post. I've created a method **Initial code** private static String padAgain(String result,int padNum) { String str = ""; for(int i = padNum; i >= 0; i--) { str = String.format("%" + padNum + "s", result).replace(" ", "*"); } return str; } to left pad the string with blank spaces (or special

导航鼠标悬浮时底部边框从中间往两边移动效果

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-22 10:18:34
经常看到这种效果,就研究了下。 <a href='' class='tag'>测试一下吧</a> .tag { text-decoration:none; position:relative; padding:10px } .tag:after{ content:''; position:absolute } .tag:after { border-bottom:2px solid #333; left:51%; right:51%; bottom:0px; transition: all .2s; } .tag:hover:after { left:0%; right:0% } 来源: https://www.cnblogs.com/chenxingbo/p/12227976.html

How can I add padding to a textarea without causing the width to increase?

◇◆丶佛笑我妖孽 提交于 2020-01-22 08:48:03
问题 I've been having trouble setting a textarea element's width and using padding via CSS. The padding value seems to change the width of the textarea, which I'd rather it not do. This is my HTML code: <div id="body"> <textarea id="editor"></textarea> </div> And my CSS code: #body { height:100%; width:100%; display:block; } #editor { height:100%; width:100%; display:block; padding-left:350px; padding-right:350px; } However, the padding values do not appear to work as one would expect. The width

How can I add padding to a textarea without causing the width to increase?

徘徊边缘 提交于 2020-01-22 08:47:44
问题 I've been having trouble setting a textarea element's width and using padding via CSS. The padding value seems to change the width of the textarea, which I'd rather it not do. This is my HTML code: <div id="body"> <textarea id="editor"></textarea> </div> And my CSS code: #body { height:100%; width:100%; display:block; } #editor { height:100%; width:100%; display:block; padding-left:350px; padding-right:350px; } However, the padding values do not appear to work as one would expect. The width

盒模型的属性

懵懂的女人 提交于 2020-01-22 07:36:39
一.属性    width:内容的宽度   height: 内容的高度   padding:内边距,边框到内容的距离   border: 边框,就是指的盒子的宽度   margin:外边距,盒子边框到附近最近盒子的距离 1.padding(内边距)    padding:就是内边距的意思,它是边框到内容之间的距离   另外padding的区域是有背景颜色的。并且背景颜色和内容的颜色一样。也就是说background-color这个属性将填充所有的border以内的区域   padding有四个方向,分别描述4个方向的padding。 描述的方法有两种    1、写小属性,分别设置不同方向的padding padding-top: 30px; 离上边30 padding-right: 30px; 离右边30 padding-bottom: 30px; 离下边30 padding-left: 30px; 离左边30    2、写综合属性,用空格隔开 /*上 右 下 左*/ padding: 20px 30px 40px 50px ; /*上 左右 下*/ padding: 20px 30px 40px; /* 上下 左右*/ padding: 20px 30px; /*上下左右*/ padding: 20px; 一些标签默认有padding   比如ul标签,有默认的padding

CSS基础(三)——盒子模型

六眼飞鱼酱① 提交于 2020-01-22 07:23:17
盒子模型 :所有页面中的元素都可以看成是一个盒子,占据着一定的页面空间,一般来说这些被占据的空间都要比单纯的内容要大。如何让元素进行位置的调整,其实就是通过调整盒子的边框和距离等参数来调整盒子的位置 盒子包括 :content(内容)、border(边框)、padding(间隙)、margin(间隔)。 盒子模型的高度=content+padding+border+margin 1.border: 一般用于分离元素 ,border的外围即为元素的最外围,因此计算元素的宽和高的时候就要将border纳入 属性(有三个):color(他的设置方法与文字的属性完全一样),width(border的粗细程度thin、medium、thick、<length>),style(样式)。 style属性: none、hidden、dotted、dashed、solid、double、groove、ridge、inset和outset。其中none和hidden都是不显示border,二者的效果相同,只是运用在表格中是,hidden可以解决边框的冲突问题。 2.padding: 用于控制content与border之间的距离,在浏览器中使用width或height属性指定了父块的宽或高,由于width和height的值中包含padding,那么content就会受到padding的挤压。(top

Why does System.Windows.Controls.Button always have a padding of 10px?

最后都变了- 提交于 2020-01-21 12:20:53
问题 See screenshot. The bounding cyan-bordered box is the button, while the blue fill is the rectangle. I cannot for the life of me figure out how to get rid of the padding in the button. Is there a way to position the rectangle to the top left so it touches the cyan border? Thanks. 回答1: Did you try setting the Rectangle 's margin to 0 ? <Button x:Name="Button" BorderThickness="0" Margin="0" Padding="0" Width="96" Height="96"> <Rectangle Fill="Blue" Margin="0" Width="96" Height="96" /> </Button>