Tuesday, October 13, 2009

Dreamweaver MX tutorial: The layer is used in page of be placed in the middle

The layer is used in page of be placed in the middle, the biggest question is the fixed position problem of the layer, after changing monitor resolution, the layer can change the position relative to element of other be placed in the middle. The article introduces an element of opposite other be placed in the middle won't the method of amlposition.

The absolutely fixed position of the layer and relative fixed position

The code of absolutely fixed position of the layer:

<div Id="Layer1" Style="position:aBsolute; Left:45px; Top:25px; Width:400px; Height:155px; Z-index:1"> </div>


The code of relative fixed position of the layer:

<div Id="Layer1" Style="position: Relative; Left:45px; Top:25px; Width:400px; Height:155px; Z-index:1"> </div>


In page of be placed in the middle, insert code of layer of relative fixed position, the position of the layer is in page be placed in the middle. But it becomes not portable, use not quite convenient.

Insert code of absolutely fixed position, contain when Left and Top losing numerical value, layer cannot be placed in the middle. After cleared Left and Top attribute, the layer is OK be placed in the middle, element of be placed in the middle of opposite page other does not have amlposition phenomenon.

Represent layer and the difference that insert a layer

Use depict a layer:

In the page of a be placed in the middle, use the code that describes a layer:

< ! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN ">
<html>
<head>
<meta Http-equiv="Content-Type" Content="text/html; Charset=gb2312 ">
<title>div</title>
</head>
<body>
<div Id="Layer1" Style="position:aBsolute; Left:40px; Top:30px; Width:265px; Height:75px; Z-index:1"> </div>
<div Align="center"></div>
</body>
</html>

  Use insert a layer:

  

In the page of a be placed in the middle, use the code that inserts a layer:

< ! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN ">
<html>
<head>
<meta Http-equiv="Content-Type" Content="text/html; Charset=gb2312 ">
<title>div2</title>
</head>
<body>
<div Align="center ">
<div Id="Layer1" Style="position:aBsolute; Width:200px; Height:115px; Z-index:1"> </div>
</div>
</body>


</html>
Because use " depict a layer " generated code is not in code of be placed in the middle, so, in page of be placed in the middle, want to make the layer does not have amlposition phenomenon relative to other element, must use insert a layer.

In page of be placed in the middle, commonly used two kinds of methods, implementation layer does not have amlposition phenomenon relative to element of other be placed in the middle.

   Use insert a layer

1. In page of a be placed in the middle, in inserting a dot to be put in documentation, in example in inserting a dot to be put in form.

  

2. Choice " insert " / " layer " menu.

  

3. A layer was inserted in documentation. In example, a layer was inserted in form. Check in IE browser, change resolution, the content of the layer won't produce amlposition phenomenon relative to element of other be placed in the middle.

  

The attribute of this layer is examined in attribute face plate, this paragraph inserted a layer to keep clear of " left " and " on " value.

This kind of method, commonly used will make play menu giving form.

   Use nest layer

Nest layer is its code includes the layer in another layer.

Before use nest layer, want to become setting of a few parameter to the layer first. Choice " editor " / " parameter chooses " menu, in " parameter chooses " in the dialog box, pitch on " Netscape 4 compatibility: Ze of ù of exhausted pool of Jia argon Kang protects Jian of chart of  shelfing  that short Tu Sao bumping into Qiao makes an appointment with browser of Ai 軳 Etscape 4. And pitch on " nest: A Chinese-style unlined garment of the larva of a tapeworm or the cercaria of a schistosome of sex of quiet of Quan  deceive people short live thin

  

Open a face plate, not pitch on " prevent jackknife " .

  

   Nest layer:

In page of a be placed in the middle, insert a form, in form, insert a layer, this layer is opposite form, won't produce amlposition. In this layer, use " insert " / " layer " command, insert one stature layer (nest layer) , no matter how move in the page this stature layer, its position is relative element of other be placed in the middle won't amlposition.

The layer is inserted in in, can insert many nest layer, move nest layer to the place of need next, such is in page of be placed in the middle is OK follow one's inclinations use layer.

Conclusion: I hope again haze of  of Jian of chart of the  that take the advantage of Gui says deceive of ィ  A Chinese-style unlined garment installs Jia Ge? " layer " use layer layout mixes command; to place content with the layer, use nest layer.

No comments:

Post a Comment