(Float:right).2. Example of normal layer and floating layerCommon layer and floating layer CSS caseCommon layer and floating layer CSS case3. Layer and floating layer summary body sense Music relaxation chairIn the above example, the ". Divcss5" object is a normal layer, and the default is a layer that does not have a floating effect, because the content of the page is left, so to see this layer left, ther
container to increase. This is not what we want to see.3.3. In case of Package content
In this case, the content width is calculated based on the content, and the width of the box is increased based on the Content width (padding width + border Width + margin width.
4. Check the box width again.
As mentioned above, setting the width for the box model only sets
the margin, border, padding these properties, want to lay out a reasonably beautiful web page, this is the basic skills.2, the material is cut, weldingOnce you know the basics of div and box modeling, you'll want to cut the material (design different div sizes) and weld it (using
at the same time. First, change the float from Box-1 to Box-2 to float: left, while the float from Box-3 to float: right, and then change the content of Box-3:
The effect is as follows:
What should I do if I don't want the text to move around the floating box? After modify
DIV CSS OptimizationDIVCSS5 to introduce simple CSS optimizations for you.Involves optimizing content:Optimization of CSS code optimization, CSS reuse optimization, shortening characters, deleting line breaks, etc.DirectoryCSS style word shorthand optimizationPunctuation opt
the divs of float: left to be displayed in the container Div, we add such a div :. In this way, the clear action is added at the end.
HoweverYes, I always think it is inappropriate to add a div. One is to add a meaningless Div, and the other is to use dojo for Drag When you drop, because this
, we have a better way to achieve what we want.
2. box-sizing
Different from the above, when you set box-sizing: border-box, this can achieve your desired purpose. For example, if we want a box with a width of PX, we can directly set the width to PX. Is it clear. When its left and right borders and left and right are
tables;
Padding: the distance between the content and the box border. It can be divided into padding-top, padding-right, padding-bottom, and padding-left;
Border (border): the border of the box, which can be split into border-top; border-right; border-bottom; border-left;
Border (margin): the distance between the box and other adjacent elements, which can be spl
Http://www.jeecn.com
The vertical text Center Method in the DIV layer sometimes needs to vertically center the text in some Div layers on the pages designed by Div + CSS for the aesthetic design of the webpage, there are many methods for multi-line text and single-line text, but there are not many simple introductions
elements, and set the padding, border, the value of the outer margin is set to an element nested in it. This nested element does not have any width value declaration, and can display the expected padding, border, and margin without interfering with the parent element.
For example, the adaptive effect. The specific code and image are as follows:
This is to adjust the appropriate width based on the screen size. This nested element does not have any width value declaration, and can display the ex
CSS box model, css boxBox Model
In the world where CSS is all framed, today I want to talk about my understanding of the CSS box model. If there is anything wrong, please pat the bricks.1. What is the
elements, the block element is characterized by: always start on a new line, height, width, row height, margin can be controlled (blocks elements); Inline element is characterized by: and other elements on the same line,... Not controllable (inline element);#box {display:block;//can simulate an inline element as a block element display:inline//effect of arranging the same row
6 minimum width of the page
Min-width is a handy
Some interesting CSS questions (II) -- about the box model and css box from the implementation of the striped border
In this series, we will discuss some interesting CSS questions. Aside from practicality, some questions will be discussed to broaden the ideas for solving the
points can be well understood and mastered if you use table layout. The box model here is different from the table layout. To learn web standards, you must first understand the box model, which is the core of Div layout. Traditional table formatting uses different sizes of tables and nested tables to locate typographical web content. After
the distance between the box border and the content in the box; width and height are the width and height of the content of the box; content is the specific content. With such a detailed division, we can easily design the web interface.
We can use a simple span tag to process a line of content. If there are multiple lines of complex content, we need to use the
following uses the Chrome browser as an example to implement an example.
Define an arrow-shadow style with the following content:
. Arrow-shadow {
-WebKit-transform: Rotate (45deg );
Border: 1px solid # aaaaaa;
Height: 40px;
Position: absolute;
Width: 40px;
}
The implementation result is as follows:
To be more full, we add the box shadow of css3,
. Arrow-shadow {
-WebKit-transform: Rotate (45deg );
-WebKit-box
as the elements are nested, that inevitably creates a relationship between the parent element and the child element, which means that we set the parent's CSS style, the ancestor (parent) and the following child (subordinate) have this property. There are certain properties in CSS, such as color, font-size, font-family, Text-align, and so on, which are passed to the child element or even passed to the grand
background image material.Cut out such a complete vertical bar image as Div+css layout footage, save as saved usingIi. Instance-specific layout code (HTML+CSS)-TOPThe case code layout is based on the inductive DIVCSS5 initialization template.1. HTML code
ul class="Array">
li>a href="http://www.divcss5.com/
CSS box model, css boxZookeeper
I will give you a detailed analysis of the box model today.
The composition of the box: content, padding, border, and margin ).
Since the box model is a box
Proficient in CSS + DIV webpage style and layout -- Preliminary Research on CSS and cssdivCSS (English name: Cascading Style Sheet) is a markup language used to control page styles and allow the separation of Style information from webpage content, DIV + CSS is the WEB desig
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.