- 浏览: 227258 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (209)
- database (25)
- java技巧 (25)
- TC总结 (4)
- J2EE (8)
- 算法 (6)
- blog (4)
- php (4)
- linux & mac (19)
- 其它技术 (4)
- javascript&ajax (26)
- 测试技术 (8)
- XML&HTML (2)
- ORM (hibernate ...) (11)
- eclipse (5)
- 技术书籍 (8)
- 项目管理,cmmi (3)
- 硬件技术 (1)
- REST, web service, web架构 (1)
- 卓有成效程序员 (2)
- qone开发 (1)
- Design (4)
- .net (5)
- SCM (4)
- css (23)
- programming languages (1)
- ide (2)
- CSS Patterns (18)
- security (1)
- android (5)
最新评论
-
Virtoway:
说到Angular JS刚读到一片美国构架师的文章关于使用An ...
angular js: angular.bind example -
08284008:
该毛线啊,一点解释的都没有,怎么看
Thread join() 用法 -
Rex86lxw:
在eclipse中我一直用Navigator查看编写代码的,可 ...
eclipse不能自动编译,不报错 -
mistake:
..............
Angular js scope: the child scope would inherit from the parent scope -
sparrow1314:
very good! thanks!
IE下JS调试工具
Positioning
The CSS positioning properties allow you to position an element. It can also place an element behind another, and specify what should happen when an element's content is too big.
Elements can be positioned using the top, bottom, left, and right properties. However, these properties will not work unless the position property is set first. They also work differently depending on the positioning method.
There are four different positioning methods.
Static Positioning
HTML elements are positioned static by default. A static positioned element is always positioned according to the normal flow of the page.
Static positioned elements are not affected by the top, bottom, left, and right properties.
Fixed Positioning
An element with fixed position is positioned relative to the browser window.
It will not move even if the window is scrolled:
Note: IE7 and IE8 support the fixed value only if a !DOCTYPE is specified.
Fixed positioned elements are removed from the normal flow. The document and other elements behave like the fixed positioned element does not exist.
Fixed positioned elements can overlap other elements.
Relative Positioning
A relative positioned element is positioned relative to its normal position.
Example
{
position:relative;
left:-20px;
}
h2.pos_right
{
position:relative;
left:20px;
}
Try it yourself »
The content of relatively positioned elements can be moved and overlap other elements, but the reserved space for the element is still preserved in the normal flow.
Relatively positioned elements are often used as container blocks for absolutely positioned elements.
Absolute Positioning
An absolute position element is positioned relative to the first parent element that has a position other than static. If no such element is found, the containing block is <html>:
Absolutely positioned elements are removed from the normal flow. The document and other elements behave like the absolutely positioned element does not exist.
Absolutely positioned elements can overlap other elements.
Overlapping Elements
When elements are positioned outside the normal flow, they can overlap other elements.
The z-index property specifies the stack order of an element (which element should be placed in front of, or behind, the others).
An element can have a positive or negative stack order:
An element with greater stack order is always in front of an element with a lower stack order.
Note: If two positioned elements overlap, without a z-index specified, the element positioned last in the HTML code will be shown on top.
发表评论
-
The 30 CSS Selectors you Must Memorize
2013-07-05 21:51 779The 30 CSS Selectors you Must ... -
Link up background image
2012-03-27 20:55 606TBD -
Simple switch themes
2012-03-27 20:53 797Problems: Two pages have s ... -
Pull common style up
2012-03-27 20:52 527Problems : For the common s ... -
Element With Attachment
2012-03-15 22:03 700Problems: Some elements has ... -
Navigation with ul and li
2012-03-15 21:15 623Problems: We need a navigati ... -
Clear floated elements
2012-03-14 21:34 509Problems: Floated elements ... -
Columns With Relative Width
2012-03-12 22:00 583Problem: Suppose we need to ... -
Blocked Wrapper
2012-03-12 21:44 679Problem: We have a container ... -
Required red star
2012-03-11 18:05 657Problem: We usually put a ... -
Overlapped Margins
2012-03-11 15:07 634Problem: The vertically neig ... -
Padding Images With Background Image
2012-03-10 21:33 672Problems: We want to display ... -
Full Screen Page Width
2012-03-09 12:02 964The page does not has a fixed w ... -
Fixed Pixels Page Width
2012-03-09 10:28 715The whole page displays with a ... -
CSS Reset
2012-03-07 22:14 553Purpose: To dismiss pro ... -
Vertically Centering With Line-Height
2012-02-26 17:58 583Problems: We want to keep th ... -
Padding Images With Absolute Position
2012-02-18 22:26 548Problems: We want to display ... -
Horizontally centering with "margin auto"
2012-02-13 22:32 643Problems: We want to keep th ... -
Wrap the line in pre
2012-02-10 17:31 609Problem: The <pre> tag ... -
hover on one part, display another part on page by CSS
2012-01-08 15:42 558.log:hover .log_manage { ...
相关推荐
1. **CSS定位(Positioning)** CSS定位是控制元素在页面上位置的关键。包括`static`、`relative`、`absolute`、`fixed`和`inherit`五种方式。其中,`static`是默认值,元素按正常文档流排列;`relative`相对定位,...
performance, and appearance of your work.You’ll learn how document flow and CSS positioning schemes will help you make your documents more accessible. You’ll discover the great styling ...
最后,文档链接指向了一个关于CSS定位(CSS Positioning)的资源,特别是浮动(floating)的概念,这是实现网页元素如图片和文本的布局的重要技术。 总结来说,这个文档主要涵盖了CSS中用于控制元素间距和边框样式...
9. **CSS Positioning and Layout** - CSS定位与布局 - 不同定位方式(如相对、绝对、固定定位)的使用场景。 - 如何利用Flexbox和Grid布局创建现代响应式设计。 - 布局中的层叠顺序和盒模型理解。 #### 三、...
Positioning in CSS Layout Enhancements for the Web 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除
4. CSS positioning position: relative 不脱离文档流,而 position: absolute 和 position: fixed 会脱离文档流。 5. 算法问题 小今和小条玩游戏的策略是让小今先取石子,然后让小条取石子,以确保小今必胜。 6. ...
DHTML 不是由万维网联盟(W3C)规定的标准。... CSS Positioning (允许您控制元素的定位和可见性) JavaScript 可视滤镜(允许您向文本和图形应用可视效果) 动态 CSS(允许您控制元素的定位和可见性)
在网页设计中,CSS(Cascading Style Sheets)...在“css-layout-and-positioning-master”这个压缩包中,可能包含了一系列关于CSS布局与定位的实例和教程,通过学习和操作这些文件,你可以更好地理解和应用这些概念。
2. **定位机制**:支持绝对定位(absolute positioning)、相对定位(relative positioning)和固定定位(fixed positioning),使得元素可以在页面上精确放置。 3. **多列布局**:CSS2允许开发者使用`column-count`...
CSS2.0是CSS的第二个主要版本,引入了许多关键特性,如定位(positioning)、浮动(floating)、层叠规则(cascading)、盒模型(box model)等,这些都对网页布局产生了深远影响。 1. **定位(Positioning)**:...
Positioning in CSS Layout Enhancements for the Web 英文mobi 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除
Positioning in CSS Layout Enhancements for the Web 英文无水印pdf pdf所有页面使用FoxitReader和PDF-XChangeViewer测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,...
2. **定位(Positioning)**:使用`position`属性,如`relative`、`absolute`和`fixed`,可以精确控制元素的位置。 3. **Flexbox(弹性盒模型)**:现代布局方案,提供了一种更灵活的方式来排列和对齐元素,尤其适合...
8. **定位(Positioning)**:CSS提供了多种定位方式,如静态定位、相对定位、绝对定位和固定定位,以实现元素在页面上的精确控制。 9. **响应式设计(Responsive Design)**:随着移动设备的普及,CSS3引入了媒体...
2. **定位(Positioning)**:通过position属性,可以设置元素相对于其正常位置或其他元素的位置。 3. **多列布局(Multi-column Layout)**:允许将内容分成多个列,提高文本阅读体验。 4. **背景图像(Background ...