Many other attributes of CSS are easy to understand, such as fonts, texts, and backgrounds. Some CSS books will also introduce these simple attributes in a great way, but ignore the explanation of some difficult attributes, which may be avoided. Attributes that are hard to understand in CSS include the box structure and positioning. Just like positioniseverything
corner of the parent element (always the upper left corner of the parent element). If the parent element style contains padding, refer to another blog --《Html css -- position learning terminator (2)); If the child element (such as the above son1)AllIf the position attribute value of the parent element is not absolute, relative, or fixed, the child element is loc
Many other attributes of CSS are easy to understand, such as fonts, texts, and backgrounds. Some CSS books will also introduce these simple attributes in a great way, but ignore the explanation of some difficult attributes, which may be avoided. Attributes that are hard to understand in CSS include the box structure and positioning. Just like positioniseverything
There are 3 ways to position CSS elements: normal flow, relative position, absolute position. Implemented by setting the Position property.
the meaning of the Position property value
Inherit
Inherits th
ArticleDirectory
1. Default position: static position
2. Absolute location-absolute position
3. Relative positioning-Relative Position
4. Fixed positioning-Fixed Position
5. Floating-floats
6. Float-clear floats
7. Z-index-my name is Z-index.
;Width: 200px;}# Div-1b {Position: absolute;/* absolute positioning of sub-elements */Top: 0;Left: 0;Width: 200px;}
Note: In this example, the height of the parent element does not change with the height of the child element. Therefore, if the background and border of the parent element need to be defined with a high enough height, it can be displayed.
6. Float | floating alignmentUse float to locate an element with float: Left; float: Right; valu
Positioning has always been a difficult point in the Web Standard application, if the position is not clear, then the effect may not be realized, the effect may be distorted. If the principle of positioning is cleared, the positioning will make the Web page more perfect.Definition of positioning:The content in CSS about positioning is:position:relative | Absolute | static | Fixed Static does not have a spec
Changes the partial transparency of the image to make the transparency Gradient based on the position.
Recently, when I was working on a project, I encountered a need to process an image to achieve the fuzzy transition of the edge.
After a long time, I finally used the following methods.
1. ARGB is used to create an image
Position of CSS, cssposition
Four property values of position:
1. relativeThe relative attribute is offset relative to its own position. If demo1 is set to a relative attribute, for example, set the following CSS code:# Demo1
{
Position
How does css make the background image stretch and fill to avoid repeated display? css background image
The question of how to stretch and fill the background image seems very simple. But I am sorry to tell you. It's not that simple as we thought.For example, you can set a b
People who have written CSS inevitably have to deal with the position attribute, but it's not easy to really understand the position property. The first two days the blogger wanted to implement an There are blocks and rows of elements in HTML. Block elements such as Div, p, and so on, in which the child elements are arranged vertically, are displayed as a piece o
In CSS, we are positioned by locating the attribute position, which has the following property values. The common attributes are as follows: Absolute generates an absolutely positioned element that is positioned relative to the first parent element other than the static anchor. The position of the element is defined by the "left", "Top", "right" and "bottom" attr
Alas, page layout and design development, for a has been engaged in background development for the cock Silk, is really a time-consuming, laborious, very difficult thing.Tonight you want to do this by overlapping multiple sheets, or by marking a different position in a picture and then assigning a hyperlink. It took a whole night to figure out a few of the following CSS property usages."1" set the label to
each ROW.There are only three cases where elements are separated from the document Flow: floating , absolute positioning , and relative positioning .Static positioning (statics):static, No special positioning, It is the default positioning method of HTML elements, that is, we do not set the Element's position property when the default position value is static, It follows the normal document flow object, th
Once wrote Web pages, learning CSS as a whole is not difficult, but is the element positioning, always a smattering of knowledge, until today, the spirit of practical knowledge of the concept, after careful testing, summed up the following conclusions.
CSS positioning: PositionStatic: The default static positioning, elements in the normal document flow can not move positioning.Absolute: Standalone element,
The positioning mode in CSS specifies where a box should be positioned on the overall layout and how it will affect the surrounding boxes. The pattern includes regular document flow, floating, and several types of position positioned elements.
Of these, the CSS position property can take 5 kinds of values:Position:ab
container) x Y value is positive.4, x y values indicate the value of the left vertex of the background image relative to the coordinate origin (that is, the left vertex of the container).5, the value of x Y can be expressed as a percentage or px.6, x y can also be used "left, right, top, bottom, center" the five alignment to express,Note: When represented by left, right, top, bottom, center, the alignment rules are applied instead of the coordinate r
each row.Static positioning (statics):Static, no special positioning, it is the default positioning method of HTML elements, that is, we do not set the element's Position property when the default position value is static, it follows the normal document flow object, the object occupies the document space, the positioning mode, top, right, Bottom, left, Z-index, and so on are invalid properties.Relative pos
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.