Document directory
<TD class = "right_chaxun_bai" align = "Left" width = "17%" style = "height: 24px; position: relative">
<Div id = "layer1" style = "position: absolute; width: 16%; Z-index: 0; left: 0px; top: 0px; margin-top: 0px;">
<Asp: dropdownlist id = "texthospitalname" runat = "server" width = "150px">
</ASP: dropdownlist>
</Div>
<Div id = "Layer2" style = "position: absolute; width: 16%; Z-index: 200; left: 0px; top: 0px; margin-top: 0px;">
<Asp: textbox id = "texthospitalname123" runat = "server" width = "130px" cssclass = "right_chaxun_input"> </ASP: textbox>
</Div>
</TD>
1. In the background, add an event to the drop-down box.
This. texthospitalname. Attributes. Add ("onchange", "texthospitalname123.value = This [selectedindex]. Text ");
2. It mainly uses the DIV attribute, position layout, and Z-index attribute.
Definition and usage
The position attribute specifies the positioning type of the element.
Description
This attribute defines the positioning mechanism used to establish the element layout. Any element can be located, but an absolute or fixed element will generate a block-level box regardless of the element type. The relative positioning element is offset from its default position in the normal stream.
Possible Value
Value |
Description |
Absolute |
Generates absolute positioning elements, which are located relative to the first parent element other than static positioning. The positions of elements are specified by the "Left", "TOP", "right", and "bottom" attributes. |
Fixed |
Generates absolute positioning elements, which are located relative to the browser window. The positions of elements are specified by the "Left", "TOP", "right", and "bottom" attributes. |
Relative |
Generates relative positioning elements and locates them relative to their normal locations. Therefore, "Left: 20" adds 20 pixels to the left position of the element. |
Static |
Default value. The element is not located and appears in the normal stream (ignore the top, bottom, left, right, or Z-index declarations ). |
Inherit |
Specifies that the value of the position attribute should be inherited from the parent element. |
The Z-index attribute sets the stacking sequence of elements. Elements with a higher stacking order are always in front of elements with a lower stacking order.
Note: An element can have a negative Z-index attribute value.
Note: Z-index can only work on positioning elements (for example, position: absolute ;)!
Description
This attribute sets the position of a positioning element along the Z axis. The Z axis is defined as the axis that vertically extends to the display area. If it is a positive number, it is closer to the user. If it is a negative number, it indicates it is farther away from the user.