padding

前端学习(94):css重置样式

守給你的承諾、 提交于 2019-12-13 10:52:07
CSS Reset,意为重置默认样式。HTML中绝大部分标签元素在网页显示中都有一个默认属性值,通常为了避免重复定义元素样式,需要进行重置默认样式(CSS Reset)。举几个例子: 1.淘宝(CSS Reset): html { overflow-x:auto; overflow-y:scroll; } body, dl, dt, dd, ul, ol, li, pre, form, fieldset, input, p, blockquote, th, td { font-weight:400; margin:0; padding:0; } h1, h2, h3, h4, h4, h5 { margin:0; padding:0; } body { background-color:#FFFFFF; color:#666666; font-family:Helvetica,Arial,sans-serif; font-size:12px; padding:0 10px; text-align:left; } select { font-size:12px; } table { border-collapse:collapse; } fieldset, img { border:0 none; } fieldset { margin:0; padding:0; }

Background image to ignore padding-top CSS

…衆ロ難τιáo~ 提交于 2019-12-13 10:16:45
问题 I have a background-image on the first section of my site however there is padding-top on that section in order to seperate the first title from the navbar. Is there a way I can get the background image to over ride the top padding? Thanks HTML <nav> <a href="#getting-his-start"><b>Getting his Start</b></a>   <a href="#cinematic-revolution"><b>Cinematic Revolution</b></a>   <a href="#experimental-phase"><b>The Experimental Phase</b></a>   <a href="#logos-made-to-last"><b>Logos Made to Last</b

CSS - Padding in IE issue?

梦想的初衷 提交于 2019-12-13 06:20:14
问题 I'm having trouble width some padding. In Chrome/Firefox it looks different than in Internet Explorer. In Internet Explorer it is much bigger. It is the .menu ul li{ display:inline; padding-right:60px; margin:0; } Why? .menu{ background-color:#000; height:35px; padding-top:15px; color:#fff; font-size:18px; } .menu ul{ padding:0; margin:0; list-style-type:none; } .menu ul li{ display:inline; padding-right:60px; margin:0; } .menu a:link{ color:#fff; } .menu a:active{ color:#fff; } .menu a:hover

CSS padding keeps inheriting

喜欢而已 提交于 2019-12-13 06:08:05
问题 I'm making a dropdown menu, but all the styles from the first ul is being added to the styles on every ul beneath the first ul. I've tried overriding the styles using !important, and moving the css to different levels. Anyone got a clue about whats going on here? This image probaly explains it the best way: http://screencast.com/t/UrkRbjjaYctp Thanks. 回答1: #menuwrapper > ul{ padding-left:37px; } #menuwrapper ul ul { padding-left:40px; } This should solve your issue 回答2: This is expected

C++ GLSL data alignment/padding

我与影子孤独终老i 提交于 2019-12-13 04:48:55
问题 I have a C++ class Matrix4x4 which has an array of 16 floats and no virtual methods: class Matrix4x4 { public: float values[16]; Matrix4x4(); Matrix4x4(float v0, float v1, float v2, float v3, float v4, float v5, float v6, float v7, float v8, float v9, float v10, float v11, float v12, float v13, float v14, float v15); Matrix4x4(const Quaternion &quat, const Vector3 &pos); void convertToQuatPos(Quaternion &quat, Vector3 &pos); void loadIdentity(); void setValues(float v0, float v1, float v2,

The mystery of the added padding [duplicate]

对着背影说爱祢 提交于 2019-12-13 04:17:17
问题 This question already has an answer here : Mystery Padding..? (1 answer) Closed 3 years ago . I recently designed and finished 2 newsletters; but when I went back to make a quick change (add a background color to the outside of the container) I realized that there is some mystery padding between the content and the background color, what I'm trying to accomplish is to get the background color right up against the edge of the main content. I've played around with the CSS quite a bit, but still

Bootstrap unwanted image padding

浪子不回头ぞ 提交于 2019-12-13 04:12:56
问题 I'm trying to make an image fill up the parent div. I have 4 images, and I want all four of them to appear side by side. Since I'm using Bootstrap, I assigned a col-xs-3 class to all four images. However, I see a small padding around the left and right of each image. Here's a preview of what it looks like: I added white borders around each image, to check if bootstrap was working correctly. The problem I have are the four rounded rectangles (Supposed to be 4 buttons), as well as the green

numpy pad with zeros creates 2d array instead of desired 1d

橙三吉。 提交于 2019-12-13 03:15:27
问题 I am trying to pad a 1d numpy array with zeros. Here is my code v = np.random.rand(100, 1) pad_size = 100 v = np.pad(v, (pad_size, 0), 'constant') result is 200x101 array, whose last column is [0,0,0,... <v> ], (leading 100 zeros), and all 1st 100 columns are zeros. How to get my desired array [0,0,0,..0, <v> ] of size (len(v)+pad_size, 1)? 回答1: The pad output is 2D because the pad input was 2D. You made a 2D array with rand for some reason: v = np.random.rand(100, 1) If you wanted a 1D array

html+css

六眼飞鱼酱① 提交于 2019-12-13 02:33:08
2019/11/26技巧 1、同级元素并排 + 宽高 = 浮动 同级元素要浮动都浮动 2、a是行内元素 想设置宽高 display: block; 3、浮动是盒子属性 子盒子不会继承 4、块级元素水平居中 margin: 0 auto; 绝对定位的元素水平居中 left:50% ; margin-left:-自身宽度的一半; 5、祖先加overflow更能管理住盒子 6、图片是行内元素 但后面的div想和图片并排显示 图片必须浮动 7、任何标签都可以使用hover 8、因为padding会渲染背景图,所以父子盒之间有距离 用父盒子的padding去挤,然后父盒子宽高内减 9、大背景一般设置水平居中 10、块级元素不设置宽度 默认撑满父盒子的内容宽;高度不设置 由标准流的内容撑开 2019/11/27技巧 1、cursor: pointer; 2、浮动元素脱离标准流,不设置宽度,内容撑开 2019/11/28技巧 1、盒子不写宽宽度就是100% 2、如果带版心的内容外面是通栏的效果,可以在版心外面加一个div 3、导航栏无序列表ul>li 外面一般再加一个div 2019/12/6技巧 1、html标签属性实现水平居中:align=“center” 2、html标签属性实现背景颜色:bgcolor=“red” 3、pre标签 预格式文本 4、 <abbr title="etctric

东拼西凑完成一个“前端框架”(3) - 侧边栏

被刻印的时光 ゝ 提交于 2019-12-13 01:30:45
写在前面 东拼西凑完成一个后台 ”前端框架“ (1) - 布局 东拼西凑完成一个后台 ”前端框架“ (2) - 字体图标 项目引入 font-awesome <link href="lib/font-awesome/css/font-awesome.min.css" rel="stylesheet" /> iconfont 自定义图标 <link href="css/icon.css" rel="stylesheet" /> 整体框架来到关键的部分,侧边栏菜单; 侧边栏 收起展开动画 说到动画我们可以通过 jQuery 、 css3 来实现,关于 css3 与 jQuery 动画的实现方式就不详细说了,简单总结以下几点: css3 使用 GPU,jQuery 使用 CPU css3 比 jQuery 更流畅,更快,更效率 jQuery 支持所有游览器 css3(animation, transition) 不支持 ie6, 7, 8, 9 css3 animation 更灵活 综上,还是推荐 css3 实现动画效果,实现动画效果可以通过 transition 和 animation 属性,这里我试用 transition 属性来实现动画; 1. 定义transition属性 .ls-layout .ls-layout-slider { width: 200px; height: