> For the complete documentation index, see [llms.txt](https://docs.servoy.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.servoy.com/reference/servoycore/dev-api/application/cssposition.md).

# CSSPosition

## Overview

The `CSSPosition` interface in the Servoy environment provides methods for managing and manipulating CSS position properties such as `left`, `right`, `top`, `bottom`, `width`, and `height`. It allows both getting and setting these properties in pixels or percentages, with chaining methods for streamlined updates. The interface supports use cases in Servoy NG Client only.

## Properties Summarized

| Type                                                     | Name              | Summary                                             |
| -------------------------------------------------------- | ----------------- | --------------------------------------------------- |
| [String](/reference/servoycore/dev-api/js-lib/string.md) | [bottom](#bottom) | Get/Set bottom css position (in pixels or percent). |
| [String](/reference/servoycore/dev-api/js-lib/string.md) | [height](#height) | Get/Set height css position (in pixels or percent). |
| [String](/reference/servoycore/dev-api/js-lib/string.md) | [left](#left)     | Get/Set left css position (in pixels or percent).   |
| [String](/reference/servoycore/dev-api/js-lib/string.md) | [right](#right)   | Get/Set right css position (in pixels or percent).  |
| [String](/reference/servoycore/dev-api/js-lib/string.md) | [top](#top)       | Get/Set top css position (in pixels or percent).    |
| [String](/reference/servoycore/dev-api/js-lib/string.md) | [width](#width)   | Get/Set width css position (in pixels or percent).  |

## Methods Summarized

| Type                                                                    | Name                   | Summary                                         |
| ----------------------------------------------------------------------- | ---------------------- | ----------------------------------------------- |
| [CSSPosition](/reference/servoycore/dev-api/application/cssposition.md) | [b(bottom)](#b-bottom) | Set bottom css position (in pixels or percent). |
| [CSSPosition](/reference/servoycore/dev-api/application/cssposition.md) | [h(height)](#h-height) | Set height css position (in pixels or percent). |
| [CSSPosition](/reference/servoycore/dev-api/application/cssposition.md) | [l(left)](#l-left)     | Set left css position (in pixels or percent).   |
| [CSSPosition](/reference/servoycore/dev-api/application/cssposition.md) | [r(right)](#r-right)   | Set right css position (in pixels or percent).  |
| [CSSPosition](/reference/servoycore/dev-api/application/cssposition.md) | [t(top)](#t-top)       | Set top css position (in pixels or percent).    |
| [CSSPosition](/reference/servoycore/dev-api/application/cssposition.md) | [w(width)](#w-width)   | Set width css position (in pixels or percent).  |

## Properties Detailed

### bottom

Get/Set bottom css position (in pixels or percent).

**Type**\
[String](/reference/servoycore/dev-api/js-lib/string.md) The bottom CSS position as a string, in pixels or percentage.

**Sample**

```js
comp.cssPosition.bottom
```

### height

Get/Set height css position (in pixels or percent).

**Type**\
[String](/reference/servoycore/dev-api/js-lib/string.md) The height CSS position as a string, in pixels or percentage.

**Sample**

```js
comp.cssPosition.height
```

### left

Get/Set left css position (in pixels or percent).

**Type**\
[String](/reference/servoycore/dev-api/js-lib/string.md) The left CSS position as a string, in pixels or percentage.

**Sample**

```js
var left = comp.cssPosition.left;
```

### right

Get/Set right css position (in pixels or percent).

**Type**\
[String](/reference/servoycore/dev-api/js-lib/string.md) The right CSS position as a string, in pixels or percentage.

**Sample**

```js
comp.cssPosition.right
```

### top

Get/Set top css position (in pixels or percent).

**Type**\
[String](/reference/servoycore/dev-api/js-lib/string.md) The top CSS position as a string, in pixels or percentage.

**Sample**

```js
comp.cssPosition.top
```

### width

Get/Set width css position (in pixels or percent).

**Type**\
[String](/reference/servoycore/dev-api/js-lib/string.md) width css position

**Sample**

```js
comp.cssPosition.width
```

## Methods Detailed

### b(bottom)

Set bottom css position (in pixels or percent).

**Parameters**

* [String](/reference/servoycore/dev-api/js-lib/string.md) **bottom** bottom position in pixels or percentage

**Returns:** [CSSPosition](/reference/servoycore/dev-api/application/cssposition.md) css position

**Sample**

```js
comp.cssPosition.r("10").b("10").w("20%").h("30px")
```

### h(height)

Set height css position (in pixels or percent).

**Parameters**

* [String](/reference/servoycore/dev-api/js-lib/string.md) **height** height position in pixels or percentage

**Returns:** [CSSPosition](/reference/servoycore/dev-api/application/cssposition.md) css position

**Sample**

```js
comp.cssPosition.l("10").t("10").w("20%").h("30px")
```

### l(left)

Set left css position (in pixels or percent).

**Parameters**

* [String](/reference/servoycore/dev-api/js-lib/string.md) **left** left position in pixels or percentage

**Returns:** [CSSPosition](/reference/servoycore/dev-api/application/cssposition.md) css position

**Sample**

```js
comp.cssPosition.l("10").t("10").w("20%").h("30px")
```

### r(right)

Set right css position (in pixels or percent).

**Parameters**

* [String](/reference/servoycore/dev-api/js-lib/string.md) **right** right position in pixels or percentage

**Returns:** [CSSPosition](/reference/servoycore/dev-api/application/cssposition.md) css position

**Sample**

```js
comp.cssPosition.r("10").b("10").w("20%").h("30px")
```

### t(top)

Set top css position (in pixels or percent).

**Parameters**

* [String](/reference/servoycore/dev-api/js-lib/string.md) **top** top position in pixels or percentage

**Returns:** [CSSPosition](/reference/servoycore/dev-api/application/cssposition.md) css position

**Sample**

```js
comp.cssPosition.l("10").t("10").w("20%").h("30px")
```

### w(width)

Set width css position (in pixels or percent).

**Parameters**

* [String](/reference/servoycore/dev-api/js-lib/string.md) **width** width position in pixels or percentage

**Returns:** [CSSPosition](/reference/servoycore/dev-api/application/cssposition.md) css position

**Sample**

```js
comp.cssPosition.l("10").t("10").w("20%").h("30px")
```

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.servoy.com/reference/servoycore/dev-api/application/cssposition.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
