sition 设置为 relative 的时候,元素依然在普通流中,位置是正常位置,你可以通过 left right 等移动元素。会影响其他元素的位置。
而当一个元素的 position 值为 absolute 或 fixed 的时候,会发生三件事:
把该元素往 Z 轴方向移了一层,元素脱离了普通流,所以不再占据原来那层的空间,还会覆盖下层的元素。
该元素将变为块级元素,相当于给该元素设置了 display: block;(给一个内联元素,如 ,设置 absolute 之后...
分类:
Web程序 时间:
2014-06-11 06:36:55
阅读次数:
307
//snakegame.h
#ifndef SNAKEGAME_H
#define SNAKEGAME_H
#include
#include
#include
#include
#include
/*枚举,表示方向*/
enum Direction{D_UP,D_DOWN,D_LEFT,D_RIGHT};
class SnakeGame:public QDialog
{...
分类:
其他好文 时间:
2014-06-10 15:57:26
阅读次数:
285
大致题意:
给定left,right,求出[left,right]中有多少数满足如下的性质:化成二进制形式后,0的个数大于等于1
组合数学,各种小边界处理很蛋疼
大致思路是
以10101100为例子,先求[0,10000000)中满足条件的数(想想该怎么求),然后求[100 00000,101 00000),[101 00 000,101 01 000)
[101 01 000,101 ...
分类:
其他好文 时间:
2014-06-10 07:38:58
阅读次数:
167
分析:
问题是将给定的二叉树变换成令一种形式,这种类型的问题,其模式是,将左子树变换成某种形式,右子树也变换成这种形式,然后再与根结点按规定的方式连接起来,那么整体就变换完成了。这个题我们就可以采用这种形式,麻烦的地方就是在进行连接的时候,我们假设根为root,左子树变换后的根为root_left,右子树变换后的根为 root_right,那么连接的时候应该是root->right = root...
分类:
其他好文 时间:
2014-06-10 07:27:10
阅读次数:
201
表A记录如下:aID aNum1 a200501112 a200501123
a200501134 a200501145 a20050115表B记录如下:bID bName1 20060324012 20060324023
20060324034 20060324048 2006032408创建这两...
分类:
数据库 时间:
2014-06-09 19:47:46
阅读次数:
248
//定义二维平面上的点struct Point{ int x; int y;
Point(int a=0, int b=0):x(a),y(b){}};bool operator==(const Point& left,
const Point& right){ return...
分类:
其他好文 时间:
2014-06-08 22:26:17
阅读次数:
357
题目
Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between).
For example:
G...
分类:
其他好文 时间:
2014-06-08 17:29:07
阅读次数:
315
题目
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).
For example:
Given binary tree {3,9,20,#,#,15,7},
3
/ \...
分类:
其他好文 时间:
2014-06-08 16:38:02
阅读次数:
194
题目
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).
For example:
Given binary tree {3,9,20...
分类:
其他好文 时间:
2014-06-08 09:23:34
阅读次数:
230
Rotating Sentences
In ``Rotating Sentences,'' you are asked to rotate a series of input sentences 90 degrees clockwise. So instead of displaying the input sentences from left to right and top to b...
分类:
其他好文 时间:
2014-06-08 04:51:34
阅读次数:
236