---
title: "Positioning"
canonical_url: "https://www.compdf.com/guides/generation-sdk/dotnet-core/generation/layout-api-positioning"
md_url: "https://www.compdf.com/guides/generation-sdk/dotnet-core/generation/layout-api-positioning.md"
description: "ComPDF SDK Guides. In this developer's guide, all the details and how to use ComPDF for SDK Guides will be covered in depth."
---

# Positioning

## Relative Positioning (Default)

Elements are arranged according to normal document flow, which is the default behavior.

```csharp
CDiv div1 = page.CreateDiv();
div1.CreateText("First div");

CDiv div2 = page.CreateDiv();
div2.CreateText("Second div"); // Will appear below div1
```

## Absolute Positioning

```csharp
// Create absolutely positioned element
CDiv div = page.CreateDiv();
div.SetAbsolutePosition(
    left: 100,    // 100 points from page left edge
    bottom: 200,  // 200 points from page bottom edge
    width: 300    // Width 300 points
);

// Or use percentage width
div.SetAbsolutePosition(
    left: 100,
    bottom: 200,
    width: CUnitValue.CreatePercentValue(50)
);
```
