Display:block is the display of elements as block-level elements.The block element is characterized by:Always start on a new line;Height, row height and top and bottom margin can be controlled;The width defaults to 100% of its container unless a width is setNline and blocks can control an element's high row width characteristics, which need to be toggled as follows:Let an inline element start from the new line;Keep The block elements and other element
Hiya ~ Me again
Before developing and managing style sheets, I want to insert a small knowledge. A few days ago, I checked the Web standard design group and asked Zhu youkang about the differences between block and inline. I remember that people often asked such questions in the past. domestic forums and foreign forums seem to be confused about what the two are. Think about the fact that many people will make some common mistakes here, so let's just
1.Inline functions and macros:
Inline extension is used to eliminate the time overhead for function calls. It is usually used for frequently executed functions. A function with a small memory space is very beneficial. So what is the relationship between inline functions and Macros ??
In fact, the functions of inline
If the problem is how C # can be as fast as C ++, then the real problem is where C # is slow. Inline is one of the many factors that affect C # performance. If a large number of small functions that are frequently called are not inline, the performance will be greatly affected, because the time for Stack creation, stack deletion, stack pressure, and redirection is likely to be longer than the time for actua
the difference between #define和inlineDefine: defines a macro that is processed during precompilation ;Simple character substitution, no type detectiontypedef: defining type aliases for handling complex typesExample: typedef int A;Then: a A;//define A as intInline: Inline functions advise the compiler whether to replace macros, and the compiler has the right to denyIt is not necessarily successful to make an application Static One, creating a backgrou
(parm* array, U value)
{
TypeName Parm::name * p;//OK: pointer declaration
}
The keyword typename can also be used in the template parameter table to indicate that a template parameter is a type.
As with non-template functions, function Templates can also be declared as inline or extern. The indicator should be placed behind the template parameter table, not before the keyword template.
OK: The keyword follows the template parameter table
Template
), so there's nothing wrong with it, and the result is 25, which is obviously correct, but if we use Squre (5+5) to invoke it, we expect the result to be 100, and the result of the macro call is (5+5*5+5) , the result is 35, which is obviously not the result we're going to get. One way to avoid these errors is to add parentheses to the macro parameters. #define Square (x) ((x) * (x)) NOTE: Macros in the call place, is simply a simple code substitution, so the parameters are enclosed in parenthes
One: Web page layout Development history
Table layout
Form +css
Floating layout of Div+css
Inline block layout for DIV+CSS
Second: The pros and cons of floating layouts that have been popular for years
Advantage:
Div+css floating layout of the advantages, mainly relative to the table layout, the main performance is the following aspects:1, faster page rendering speed;2, better background p
Block-level elements: div p H1 H2 H3 h4 form ULInline elements: A b br i span input SelectCSS box model: Content, Border, margin,paddingDisplay properties in CSS (inline elements and block-level elements)The Display property values we use are:inlineblockinline-blocknoneSetting display to none will not preserve the space that the element should have shown, but visibility: hidden it will remain.What we care about the most is the display:inline、display:b
The conclusion of the existence of inline functions is that:
Inline functions are introduced to solve the problem of function call efficiency
Because calls between functions are transferred from one memory address to another, the address of the original function execution is returned when the function call is complete. function calls have a certain amount of time overhead, and an
1. Definition:The member functions declared or defined in the class declaration are called inline functions. -- ** I think this statement is not comprehensive.Inline functions are used to declare functions or add the "inline" mark before implementation to indicate that the functions can be processed by inline functions during compilation. But whether it is really
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
What is the difference between block and inline? Before developing and managing style sheets, I want to insert a small knowledge. Looking at the web standard design group a few days ago, long youkang asked about the difference between block and inline. I remember that people often asked such questions in the
What is an inline function?Inline (caution, not online), translated into "inline" or "inline". Meaning: When the compiler discovers that a piece of code calls an inline function, it does not call the function, but instead inserts the code of the function into the current pos
In a program, a function call takes a certain amount of time and space (to protect the site) overhead. When we call small functions frequently, the cost of the function calls is relatively large (calling complex functions), so we need the same as the C language macro definition function (pre-compile will have a macro expansion), these small function code (at compile time) copied to the caller, To reduce the cost of function calls. to do this, we need to put a keyword
(1) What is an inline function?An inline function is a member function that is defined within a class, that is, the function body of the function is placed inside the class.(2) Why inline functions are introduced?Of course, the main purpose of introducing inline functions is to solve the efficiency problem of function
Inline functions and virtual functions
The Inline attribute of the function is determined during compilation. However, the nature of virtual is determined during runtime. The two attributes cannot exist at the same time and can only have one choice, the Inline keyword in the file is only a suggestion to the compiler. Whether the compiler adopts the keyword is a
In many cases, we have to make some block elements display side by side. Generally, floating is required, but when the block elements float to the margin (margin), a double BUG will occur in IE, therefore, we often have to put this block element in an inline element, and then float and margin the inline element. Today, I saw some articles about display: inline-bl
The display: inline-block attribute is often exposed when CSS is used for performance. Whether it's a friend who has been familiar with web standards or standards for a long time, metropolis is confused and vague about this attribute.Display: inline-block
Quote:
The object is presented as an inline object, but the content of the object is presented as a block ob
ArticleDirectory
1. display: inline-block
2. inline-block in IE
3. Other browsers
4. References
1. display: inline-block
2. inline-block in IE
3. Other browsers
4. References
1. display: inline-block
Let an element have the attribute of "bl
Block, inline-block, inlineinline-block
The display: block element has the following features:Always starts on a new line;Height, row height, and top and bottom margins can be controlled;The default width is 100% of its container, unless a width is set.The display: inline element features:And other elements are on one line;High, the Row Height and top and bottom margins cannot be changed;The width of a text
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.