as the minimum width. To enable this command to be used on IE, you can place Then CSS is designed like this:
# Container {Min-width: 600px;Width: E-xpression (document. Body. clientwidth }
The first Min-width is normal, but the width of line 2nd uses JavaScript, which is recognized only by IE, which will make your HTML document not formal. It actually achieves the minimum width through javascript judgment.
as #333, the font color in IE6 is displayed as #666, And the font color in IE7 is displayed as #999.2. center problem in CSS layoutThe main style definition is as follows:Body {text-align: center ;}# Center {margin-Right: auto; margin-left: auto ;}Note:First, define text-align: center in the parent element. This means that the content in the parent element is centered. for IE, this setting is enough.Howeve
guarantees that it is connected under other elements, not next. Because it uses relative positioning, its position on the page is determined by the flow of other elements, which are specifically determined by the DIV enclosing the three columns. Rule margin-top:100px is an important detail that prevents the footer from being overwritten by the column above. These columns are offset from their regular positions in the page flow to
that the element is at least or less than a certain width, so as to ensure correct layout. But IE does not recognize this, but it actually uses width as the minimum width. To enable this command to be used on IE, you can place Then CSS is designed like this:# Container {Min-width: 600px;Width: expression (document. Body. clientwidth }The first Min-width is normal, but the width of line 2nd uses JavaScript, which is recognized only by IE, which will
Why to initialize CSS, what is the role?
Each time we create a new Web site or new page, we initialize CSS style attributes to make it more convenient and accurate for the CSS or HTML tags we use. If we do not initialize CSS style properties, will increase the amount of
margin is a very practical trick, if you want to let container fixed width center display (assuming container width of 700px), you can use relative positioning method for container, left value is 50% of the page, Set the Margin-left to half the width of your own, so that the displayed effect is fixed width and centered, regardless of the resolution in the browser, such as: When the content on the page is not displayed enough, how to
is displayed normally. In addition, the drag dropNo problem. Originally, the CSS of this Clearfix uses the after pseudo object, which will add content at the end of the element that applies Clearfix.
Here we add a period "." and set its display to block; its height to 0; clear to both; and visibility to hide. In this wayThe goal is to open the container.
However, Windows IE does not support this. To make
margin is 0, the left or right is automatic, so the layer is centered automatically.If you want to leave the page on the left, then cancel the auto value is OK, because the default is the left display.By Margin:auto we can easily center the layer automatically.
5, here I only introduce these commonly used CSS properties, other please refer to CSS2.0 Chinese manual.
When we have written the general
margin is 0, the left or right is automatic, so the layer is centered automatically.If you want to leave the page on the left, then cancel the auto value is OK, because the default is the left display.By Margin:auto we can easily center the layer automatically.
5, here I only introduce these commonly used CSS properties, other please refer to CSS2.0 Chinese manual.
When we have written the general
can write a CSS file like this: #1 {color: #333;}/* Moz */
* Html #1 {color: #666;}/* IE6 */
* + Html #1 {color: #999;}/* ie */The font color in Firefox is #333, And the font color in IE6 is #666, in IE7, the font color is displayed as #999. 2. The main style definition of the center problem in the CSS layout is as follows: body {text-align: center ;}
# Center {margin-Right: auto; margin-left: auto;} Descr
How to make a div float on top of another Div
It's just the demo.
DOCTYPE HTML Public "-//W3C//DTD XHTML 1.0 strict//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd ">Metahttp-equiv= "Content-type"content= "text/html; charset=gb2312" />styletype= "Text/css">
{ position:absolute; top:20p
on IE, you can put a Then CSS is designed like this:# Container {Min-width: 600px;Width: expression (document. Body. clientwidth }The first Min-width is normal, but the width of line 2nd uses JavaScript, which is recognized only by IE, which will make your HTML document not formal. It actually achieves the minimum width through javascript judgment.
7. padding and margin of UL and form labels
UL labels have
First, using automatic margin to achieve the center
The preferred way to center elements horizontally in CSS is to use the margin property-set the Margin-left and Margin-right properties of the element to auto. In practical use, we can create a container-scoped div for these elements that need to be centered.
It is important to note that you must specify a wid
CSS how to make div layer Horizontal center today with CSS encountered a very difficult problem, div itself does not define its own center of the property, many methods on the Web are introduced with the superior text-align:center and then nested a layer of
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 CSS command that specifi
reconstruction engineer. What a nice name is, you can never ask someone to call your Div + CSS staff.
In "Beyond CSS", they still recommend that you use less Div and more labels reasonably. Do not forget that there are many P and form tags in XHTML. The rational use of tags and a reasonable page structure
css| Specification | Web page
Web developers (that is, you) can identify the div and other page elements and tags by creating CSS classes and ID names and using those names. For developers, when naming CSS selectors for redefining XHTML tags (tags), you must ensure that they match exactly the predefined tags, but in te
call yourself a website reconfiguration engineer, what a nice name, can not let others call you DIV+CSS personnel.
In the "Beyond the CSS", they still recommend less use Div, more reasonable use of tags, do not forget in the XHTML there are many p,form tags. Reasonable use of tags, a reasonable page structure will
In web authoring, there are many terms, such as: CSS, HTML, DHTML, XHTML, and so on. In the following article we will use some basic knowledge of HTML, and before you learn this introductory tutorial, make sure you have a certain HTML base. Let's start by using DIV+CSS to design your Web page layout in one step.All the
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.