inline

css li 空隙问题

ε祈祈猫儿з 提交于 2020-01-25 14:48:40
IE6/7的Bug:纵向排列的li中加浮动元素产生向下3px的空隙 最近做页面时,经常碰到用 li 标签做纵向列表的时候,会在li的下面产生3px的空隙,之前也碰到过,但都用简单的方法解决了。搜索了一下,网上已经有人给出一些解决方案,但细看之后发现他们的解决方案和找到的原因都有些问题,甚至是错误。要么只单纯地提出问题,解决问题,没有更详细的探讨。所以这二天抽空写了一个demo,对这个bug做了一点研究。 bug实例如下: li与li之间应该是没有任何空隙的,因为我没有设置margin-top,或margin-bottom的值。这就是3px的bug。 HTML原代码 : <ul class="list-1"> <li> <span>我有浮动</span> <a href="#">我有浮动</a> <strong class="red">这里所有的元素都浮动</strong></li> <li> <em>inline元素</em> <span>Span float:left;</span> <a href=" http://hadaiye.blog.163.com/blog/#">A float:left;</a> <div class="red">我不浮动,且不是最后一个元素</div> <strong>Strong float:right;</strong> </li> <li>

Sortable div with TinyMCE inline

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-25 08:06:22
问题 The code posted by vijayscode (https://stackoverflow.com/questions/34850038/tinymce-4-not-working-with-sortable-jquery-divs/59896435#59896435) doesn't work for me. TinyMCE doesn't work even before I start ordering. Does sorting work with TinyMCE in when using inline mode? For example, if I add the inline: true option to this code ... TinyMCE is not loaded immediately http://fiddle.tinymce.com/33faab Can you show me a working example on http://fiddle.tinymce.com/ 回答1: You are really asking two

Sortable div with TinyMCE inline

只愿长相守 提交于 2020-01-25 08:06:06
问题 The code posted by vijayscode (https://stackoverflow.com/questions/34850038/tinymce-4-not-working-with-sortable-jquery-divs/59896435#59896435) doesn't work for me. TinyMCE doesn't work even before I start ordering. Does sorting work with TinyMCE in when using inline mode? For example, if I add the inline: true option to this code ... TinyMCE is not loaded immediately http://fiddle.tinymce.com/33faab Can you show me a working example on http://fiddle.tinymce.com/ 回答1: You are really asking two

「HNOI2016」序列

萝らか妹 提交于 2020-01-23 23:47:04
「HNOI2016」序列 传送门 考虑莫队,瓶颈在于如何 \(O(1)\) 的更新扩展后区间的答案。 我们只讨论左端点向左扩展的情况,其他情况类同。 假设从 \([l + 1, r]\) 扩展到 \([l, r]\) ,那么也就多出了 \([l, l], [l, l + 1] \cdots [l, r]\) 这些区间,考虑计算这些区间的答案。 首先找到这段区间的最小值所在位置 \(p\) ,那么右端点位于 \([p, r]\) 的区间的答案都是 \(a[p]\) 。 另一部分用前缀和算:记 \(f[i]\) 为 \(i\) 为左端点时到后面位置的贡献这个可以用单调栈预处理一下然后从后往前转移: \(f[i] = f[R[i]] + (R[i] - i) \times a[i]\) 。 \(R[i]\) 表示右边第一个比 \(a[i]\) 小的数的位置。 具体细节可以看代码。 参考代码: #include <algorithm> #include <cstdio> #include <cmath> #define rg register #define file(x) freopen(x".in", "r", stdin), freopen(x".out", "w", stdout) using namespace std; template < class T > inline

BFC的概念及作用

巧了我就是萌 提交于 2020-01-23 18:26:05
在了解什么是BFC之前,首先得明白什么是Box , Formatting Context (一个决定如何渲染文档的容器)的概念 Box: CSS布局的基本单位 Box是 CSS 布局的对象和基本单位, 直观点来说, 就是一个页面是由很多个 Box组成的, 元素的类型和display属性, 决定这个BOX的类型, 不同类型的BOX, 会参与不同的Formatting Context, 因此BOX内的元素会以不同的方式渲染, 其盒子的类型分别为: block-level box:display 属性为 block, list-item, table 的元素,会生成 block-level box。并且参与 block fomatting context; inline-level box:display 属性为 inline, inline-block, inline-table 的元素,会生成 inline-level box。并且参与 inline formatting context,若为block-level box 设置inline-block则会产生BFC run-in box: css3 中才有, 这儿先不讲了 Formatting Context :是W3C CSS2.1规范中的一个概念,它是页面中的一块渲染区域, 并且有一套渲染规则,他觉得了子元素如何定位,

Metamorphic Example Code

◇◆丶佛笑我妖孽 提交于 2020-01-23 17:37:29
问题 So I've been working on implementing the metamorphic code example from James Holderness found here: Metamorphic Code Examples. #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include <time.h> #define PUSH 0x50 #define POP 0x58 #define MOV 0xB8 #define NOP 0x90 #define ADD 0x01 #define AND 0x21 #define XOR 0x31 #define OR 0x09 #define SBB 0x19 #define SUB 0x29 #define JUNK asm __volatile__(PUSH,NOP,NOP,NOP,NOP,NOP,NOP,NOP,NOP,POP) #define JUNKLEN 8 const unsigned

Metamorphic Example Code

怎甘沉沦 提交于 2020-01-23 17:37:26
问题 So I've been working on implementing the metamorphic code example from James Holderness found here: Metamorphic Code Examples. #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include <time.h> #define PUSH 0x50 #define POP 0x58 #define MOV 0xB8 #define NOP 0x90 #define ADD 0x01 #define AND 0x21 #define XOR 0x31 #define OR 0x09 #define SBB 0x19 #define SUB 0x29 #define JUNK asm __volatile__(PUSH,NOP,NOP,NOP,NOP,NOP,NOP,NOP,NOP,POP) #define JUNKLEN 8 const unsigned

Difference between __always_inline and inline

▼魔方 西西 提交于 2020-01-23 07:01:05
问题 There is a nice explanation of using inline instruction on another question Could anyone explain me if there is any difference using inline and __always_inline on a header file? And, when I would prefer __always_inline over inline or vice-versa? 回答1: Always inline function attribute indicates that a function must be inlined. The compiler attempts to inline the function, regardless of the characteristics of the function. However with inline attributes the compiler does not inline a function if

react+wabpack 搭建

点点圈 提交于 2020-01-23 02:21:04
一、创建package.json文件 npm init 一路回车,包文件创建成功。 二、安装react(--save 可以将依赖保存到包文件中) npm install react react-dom --save-dev 三、安装babel npm install babel-core babel-loader babel-preset-es2015 babel-preset-react --save-dev 四、webpack相关 1、安装webpack npm install webpack --save-dev 2、项目搭建 我的项目目录如下: app内包含components、js、css、images等静态资源,main.js是入口文件,build是打包后的文件夹 这里需要创建配置文件webpack.config.js,大致内容如下: var path = require('path'); var webpack = require('webpack'); //var precss = require('precss'); //var autoprefixer = require('autoprefixer'); var ExtractTextPlugin = require("extract-text-webpack-plugin"); var

BZOJ 2733: [HNOI2012]永无乡

爷,独闯天下 提交于 2020-01-22 22:16:53
初始给定一个n个点m条边的无向图,q次操作,每次要么新增一条边,要么查询与某个点相连的所有点里点权第K小的点的编号。 查询联通分量容易想到并查集,查询第K大需要用平衡树,容易想到每个联通分量维护一棵平衡树, 每次新增加一条边对联通分量的影响就是合并两颗平衡树,为了保障复杂度正确,我们采用启发式合并,每次把小的联通分量的每个值暴力插到大的联通分量中, 简单来看,启发式合并一次,容量至少对小的联通分量来说是翻倍,再加上插入平衡树的均摊复杂度是O(logn)的,乍一看复杂度是O(nlog^2n)的 (不过camp讲课的时候说,把小的Splay的每个数值从小到大插入到大的Splay中,时间复杂度是O(nlogn)的,证明需要用到Dynamic Finger Theorem) 然后,貌似就做完了 #include<bits/stdc++.h> using namespace std; const int maxn=5e5; const int INF=0x3f3f3f3f; typedef long long ll; struct Splay { int ch[2]; int fa; int cnt,val,sz; }b[maxn+5]; int father[maxn+5]; int tot=0,root[maxn+5]; inline int newNode(int fa,int val