Home >Common Problem >What is the property that determines the position of a control on a form?

What is the property that determines the position of a control on a form?

藏色散人
藏色散人Original
2021-06-01 15:58:536806browse

The properties that determine the position of a control on the form are Top and Left; the top property specifies the top edge of the element, which defines the distance between the top margin boundary of a positioned element and the top boundary of its containing block. Offset; the left attribute specifies the left edge of the element, which defines the offset between the left margin edge of the positioned element and the left edge of its containing block.

What is the property that determines the position of a control on a form?

The operating environment of this article: Windows 7 system, Dell G3 computer.

What is the property that determines the position of a control on a form?

The properties that determine the position of a control on the form are Top and Left.

Determining the position of a control on the form is determined by the two properties Top and Left.

The top attribute specifies the top edge of the element. This attribute defines the offset between the top margin boundary of a positioned element and the top boundary of its containing block.

The left attribute specifies the left edge of the element. This attribute defines the offset between the left margin edge of the positioned element and the left edge of its containing block.

What is the property that determines the position of a control on a form?

Related introduction:

CSS properties can also be dynamically changed through a piece of JavaScript.

Script syntax:

object.style.top="100px"

Example:

This example sets the top edge of the paragraph to 20 pixels below the top edge of the window:

p{position:absolute;top:20px;}

This example sets the top edge of the paragraph to 20 pixels above the top edge of the window:

p{position:absolute;top:-20px;}

Possible values

auto: Default. Calculate the top position through the browser.

%: Sets the percentage position of the top of the element to the top edge of the nearest parent element with positioning settings.

length: Use units such as px, cm, etc. to set the position from the top of the element to the top of the nearest top edge with positioning settings. Negative values ​​can be used.

Recommended learning: css video tutorial

The above is the detailed content of What is the property that determines the position of a control on a form?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn