1. What is the difference between block-level elements and inline elements?Block-level element exclusive rowInline elements can be displayed on a single line, but cannot set the upper and lower padding and margin values.2, block-level elements and inline elements of the conversion of each other?Block-level elements in the change-in element: Display:inline;Inline
Advantages of inline functions:One: the inline function of the class defined by inline, the code of the function is put into the symbol table and replaced directly (as the macro definition expands), without the overhead of the call, the efficiency is high.Second: The introverted function of a class is a real function.Three: Use
1. Get in-line (inline) style:obj.style.attr; Gets a non-inline style.2. Set the inline style:Obj.style.attr = value;3. Get non-inline styles:function GetStyle (obj,attr) { //get non-inline style, obj is an object, attr is the value if (obj.currentstyle) {/ /get non-
Display:block
The block element will have a single row, and multiple block elements will have their own new row. By default, the block element width automatically fills the width of its parent element.
The block element can set the Width,height property. Block-level elements, even if they are set to a width, are still exclusive rows.
The block element can set the margin and padding properties.
Display:inline
The Inline keyword is used to define an inline function of a class. The main reason for introducing it is to use it to replace the macro definition in expression form in C.
An example of macro definition in expression form:
# Define expressionname (var1, var2) (var1) + (var2) * (var1)-(var2 ))
1. Why macro in expression format?
1). High macro execution efficiency. Because it is directly replaced by text at
The value of the previously used display property will only be used inline or block, the two values are displayed as follows:(1) Inline: The Display:inline is set, the element of the attribute is not wrapped, and even if the element is set to a wide height and has no effect, belonging to the inline element, a typical inline
block element block-level elements > As the name implies is the element displayed as a block, height width is a that can be set. For example, our commonly used inline element inline elements , and its width is the width of its own text or picture. The As defined in the CSS authoritative guide, "any visible element that is not a block-level element is an
1. Problem IntroductionThe above code means that you want to get the left property value of the id= "Div1" element. But when we run the code above, we will find that the popup content of the pop-up window does not have anything.We clearly defined the left property of the element in the tag, why alert (oDiv.style.left); Does it return a pop-up window with nothing?In fact, the cause of this problem is: ODiv1.style.left such a format to get left is a non-inlin
Issue backgroundWhen some HTML tags use box model properties, some properties fail?Block element exclusive row (whether to add width), the element before and after the other content to wrap directly applicable box model of all CSS properties of the row element is not exclusive row, multiple rows of elements can be rendered in a row part of the applicable CSS box model properties: • Width, height settings are not valid • Margin settings: Effective, up or down invalidCommon block elementsTags De
margin:0 Auto/* Allows the box to be centered */1. Writing methods of three style sheets(1) Inline notationFeatures: Styles only work on the current file, without really implementing the structural representation separation.(2) Outer chain styleFeatures: The scope is the current site, who call who takes effect, a wide range, truly realize the separation of structural performance.(3) Inline style sheetFeatur
Inline can be placed in. cpp, but only this CPP file can use it at this time.To make a public object, you must put it in. H. If you do not want to put it in. H, you must copy one copy of each CPP file.In fact, even if it is put in. H, it is also a copy of each CPP file, but the compiler completes this copy for you.If the inline function is repeated, it will not cause a connection error. That is, it can be d
An important factor that affects performance is the inline technique. Inline functions can also be called inline functions.In C + +, function calls need to set up a stack environment, copy the parameters, protect the call site, return the return value to replicate, restore the call site. These are the additional costs that are unrelated to the actions that are pe
NoneThis element is not displayed.
Block: This element is displayed as a block-level element.Line Break.
Inline default. This element is displayed as an inline element, before and after the elementNo line break.
Inline-blockIntra-row block elements. (Newly added value of css2.1)
In CSS, inline-block: submits an o
First, CSS box model
The following two images can illustrate the CSS box model, the difference between padding and margin, padding in the border, margin outside the border. Personal understanding is around the label node to design the style, it must remember the definition of the style of what it is to be effective, useful ...
ii. Classification of elements
Element Classification--block-level elementsWhat is a block-level element. In HTML a{
Display:block;
}
Block-level element features:1, ea
The ontology and name of a function call are also clear and easy to understand.Insert the function body at the function call point and remove the function.
IntGetrating () { ReturnMorethanfivelatedeliverise ()? 2: 1; } BoolMorethanfivelatedeliverise () { Return_ Numberoflateliveries> 5; }
int getrating () { return _ numberoflateliveries> 5? 2: 1; }
Motivation: Sometimes you may encounter some functions.CodeIt is
Block Element display: Block
1. I am a block-level element and always start in a new row.
2. width, height, row height, and top and bottom can be controlled. (The default value is 100% of the width and height of the container)
3. My vertical adjacent margins are merged. The maximum value is used by default.
Inline element display: inline
1. I am an in-row element, and other elements are on the same lin
Block elements:It is generally the container element of other elements, can accommodate block elements and inline elements, which by default will not be the same line with other elements, that is, the equivalent of two blocks are written together vertically layout. The most common is div and PInline elements:Inline element is also called inline element, it can only accommodate text and other
Inline member functions and non-inline member functions in C + + can be divided into two situations:1. If the Declaration and definition of the member function are together, then the member function is inline, whether or not it is written inline, as follows:Using namespace Std;class test{public:void fuc () {cout Or:Usi
HTML5 inline label aggregation (Part 1) and html5 inline
Inline element, which shares a row with others, but the setting width and height is invalid. Features:
① And other elements are on one row
② High, the row height, outer margin, and inner margin cannot be changed;
③ The width of the text or image cannot be changed.
④ Inl
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.