, at least can let the general users without web development experience to quickly read the content. From this perspective, CSS layout code should have a better aesthetic experience.
You can imagine a block container element div as a box, or it's easier to understand if you play a scrapbook. We first cut the articles we need from all kinds of newspapers and magazines. Each cut is a block. Then we put the pieces of paper back on a blank new piece of p
, they are separated into two sections for differentiation. However, in any case, the introduction of pseudo classes and pseudo elements is because some information in the document tree cannot be fully described. For example, CSS does not have a selector such as the first line of a paragraph, this is necessary in some publishing scenarios. In the standard:CSS introduces the concepts of pseudo-elements and p
)./////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////Let's first understand that all HTML elements are either blocks (block elements), or inline (inline elements). Here's a look at the features of block and inline:Features of
change the layout level of an element by setting the Display:inline and Display:block.Several common property values in the Display propertyDisplay:none is the element hide does not showDisplay:block1, the block element will be exclusive row, multiple block elements will be a new row. By default, the block element width automatically fills the width of its parent element.2. The block element can set the Width,height property. Block-level
(intrinsic dimensions), and they can set the Width/height properties. Their nature is consistent with the elements that set the Display:inline-block.Margin in the block-level element, his performance can be fully reflected, up and down any of your settings.Margin can also be used for inline elements, which is allowed by the specification, but Margin-top and margin-bottom have no effect on the height of the
element.1, a SPAN element not set wide, plus 1 pixels blue solid Line display effect is Jiangzi:2, to his father plus 50px height after is Jiangzi:There is no change between 1 and 2.3, add 50px height to him is Jiangzi:1, 2, 3 shows are exactly the same.Normal document flow the inline is not supported by the wide setting, so the span in the example does not inherit the father's width and height, and the width of his own setting does not work. The height of its own is actually the value of its d
DefinedThe traditional block-level element definition simply illustrates the formation of a block in the document flow, with the addition of lines in front and back, which is somewhat general. In fact, the box element refers to the macro on the box element, it consists of 3 types: 1. Block-level element 2.dispaly is set to Class block 3. The inclusion of some elements forces them to form block-level elements
and lower margins, but has left and right margins and all padding
Ignore width and height properties
If you set a float, it becomes a block-level element that will have all the attributes of the block-level element
Support for vertical-align Properties
The inline element behaves like a text box. They will appear next to each other.Inline element Tags:, , , , , , , .
We can note that
The STL selects the method to delete elements with caution, and the stl selects the elements with caution.Zookeeper
1. Delete all objects with specific values in the container
1. If the container is a vector, string, or deque, use erase-remove. For example:Vector
C. erase (remove (c. begin (), c. end (), 1963), c. end (); // delete an element whose value is 1963
Usage is similar to Android's Android:layout_weight property, which can be compared with the use of Android, so it is very easy to remember, because all browsers do not support most of the properties, so all the attributes need to add Firefox, Safari, Opera, and Chrome support alternative -moz-and -webkit-prefixes, and now basically all of the CSS3 properties sh
1, block-level element row-level elements?Block-level element features:① always start on a new line;② height, row height, margin and inner margin can be controlled;The ③ width defaults to 100% of its container, unless a width is set;④ it can accommodate inline elements and other block elements.Features of inline (inline) elements:① and other
)"). appendTo ($ ("p"); // Add multiple targets
For the first picture, the colleague adds it to three p tags, and for the second picture, add it to one P element separately. From the execution result, we can see that, the first image is added as a copy to three P elements, while the second image is added as a move.
Corresponds to the append () and appendTo () methods. JQ also provides the prepend () and prependTo () methods. These two methods are us
First, we must correctly understand what is a child element. For example, we wrote a span tag on the Web page. and write the text in span: "Welcome to the cloud community", so this text content is a child of span. The same if span is contained by a Div. Then span is the child element of the Div. Look at the following code:
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
As you can
In-line elements (inline element), also called inline elements;
Inline elements can hold text or other inline elements, and common inline elements include
Block element:
Block elements are generally started from new rows, and
black hair. Unless the child wants to dye grey hair and talk, not the parent's child to talk about otherwise.
Not all CSS properties are inherited, because some of them are meaningless. For example, margins are not inherited because child elements are less likely to need the same margins as their parent elements. In most cases, common sense will tell you which p
with keyboard input focus.
: First-child
The pseudo class will be applied to the first time an element appears on the page.
: Lang
The pseudo-class is applied when the element carries the specified lang.
: Root () Selector
Matching Element E is the root element of the document. In the HTML document, the root element is always
: Not ()Selector
The negative selector is exactly the same as the: not selector in jQuery. You can select all
elements of a common line.
2, the height of the element, the width, the row height and the top and bottom margin are all can be set.
3, the width of the element if not set, the default is the width of the parent element.
After reading these three CSS block-level element features, this has a further understanding of CSS elements, then let's take a look at the CSS
Block-level elements: block-level mostly structural tagsInline elements: Most of the lines are descriptive tagsPhotos of • Block-level elements1. Always start with a new line2. Height and width are controllable3. When the width is not set, the default is 100%4. Block-level elements can contain block-level elements and
New structure elementsIn HTML5, the following structure-related elements have been added:Section elementA section element represents a chunk of content in a page, such as a chapter, header, footer, or other part of a page.It can be used in conjunction with H1, H2, H3, H4, H5, H6 and other elements to identify the document structure.code examples in HTML5:code examples in HTML4:article ElementsThe article el
Document Stream
The form is divided into rows from top to bottom, and the elements are discharged from left to right in each row, that is, the document stream.
Each non-floating block-level element occupies only one row, and the floating element floats at one end of the row as required. If the current row cannot accommodate it, a new row will be floated.
An inline element does not exclusive to a row. Almost
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.