The DIV attribute is implemented in ASP. NET. The text box and the drop-down box are combined to enable text box input and selection.

Source: Internet
Author: User
Document directory
  • Description
  • Description

<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.

 

 

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.