position:fixed 演示

属性 position 可应用于所有元素

它的取值范围: [static, absolute, fixed, relative, sticky, inherit]

static: 默认值,无定位功能,直接忽略 top, bottom, left, right, z-index 属性

relative: 元素框偏移某个距离,元素仍保持原来的形状,它原本所占的空间仍保留

absolute:元素被剔除,相对于它的包含块定位,并成为一个块级框。

fixed: 类似absolute, 只是它的包含块为视窗。

元素包含块的确认

position层次: relative 内的 absolute元素。

style="position: absolute; top:50%; bottom: 0; left:50%; right: 0;background-color: teal;"
width min-width max-width 共同调节

position:sticky top:20px;

position 为 默认值的 main 元素

We have been talking about various things that concern our daily life. We are not indulging in any form of theories, beliefs, or ideological, speculative entertainment. We are actually deeply concerned - I hope - with our daily life and to find out if it is at all possible to bring about a radical change in the ways of our life. Because our life is not what it should be. We are confused, miserable, sorrow-ridden, struggling, struggling from day after day till we die. And that seems to be our lot. This endless conflict, not only in our personal relationships but also with the world, which is deteriorating from day to day, becoming more and more dangerous, more and more unpredictable, uncertain, where the politicians and the nations are seeking power.
And we should also talk over together this morning, I think, about freedom whether man or woman - when I use the word 'man' I include the woman, I hope you don't mind, Women's Lib. It seems to one, as one observes in the world, in our daily life, freedom is becoming less and less.
And we should also talk over together this morning, I think, about freedom whether man or woman - when I use the word 'man' I include the woman, I hope you don't mind, Women's Lib. It seems to one, as one observes in the world, in our daily life, freedom is becoming less and less. More and more restrictive we are becoming, our actions are limited, our outlooks are very narrow, or bitter, cynical, or very, very hopeful, and we never seem to be free from our own daily conflict and misery, completely free from all the travail of life. And I think we should talk over together this question of freedom. Of course in the totalitarian states there is no freedom. Here in the western world and the eastern world, partly, there is somewhat more freedom - freedom to change your job, freedom to travel, to say what you like, to think what you like, express what you like, write what you like. But even this freedom that one has is becoming more and more mechanical, it is no longer freedom.

position 为 relative

This morning it will be good to talk over together, as we have talked over fear, pleasure, sorrow, pain and death, I think we ought to talk over this morning the very complex and subtle problem of what is meditation. It is quite a serious issue and perhaps some of you will kindly pay sufficient attention to what is being said, if you care to.
This word is now becoming so common, even the governments are beginning to use it, even the people who want money are trying to meditate more to get more money. They are trying to meditate in order to become quiet so that they can do better business. And the doctors are practising meditation because it will help them to operate properly, and so on and on and on and on. And there are different kinds of meditation - Zen, Tibetan and the ones you invent for yourself. And with all this in mind, the Indian type of meditation, the Tibetan, the Zen, the Encounter Group meditation and the aspiration to have a still, quiet, silent mind, bearing all this in mind, let us try to find out, if we can this morning, why one should meditate and what is the significance of meditation.

匿名文本 anonymous text
不在行内元素的字符串
em框 字符框 character box
与font-size成正比 在无额外行间距时为基线之间的距离
内容区
各字符的em框串在一起构成的框
行间距 leading
font-size 与 line-height 的 差
行内框
高度=非替换元素的line-height 或 替换元素的高度
行框
max(行内框1,行内框2,...)
行内元素的边框
要包围内容区及其所有内边距和边框
替换元素的外边距和边框会影响行内框的高度