> For the complete documentation index, see [llms.txt](https://design-packs.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://design-packs.gitbook.io/docs/fundamentals/custom-css/basic-css-examples.md).

# Basic CSS examples

### How to select the entire section

All of the styles that you add are scoped to that specific section (which means you can style two Design Packs totally differently and not have to worry about any interfering styles or inheritance issues)

To select the entire section, use empty brackets, instead of using the id selector (eg. #DP--12344789 is not needed). Not sure what that means? Here is an example:

```css
{
  border: 3px solid red;
}
```

If you copy and paste the above code, you will see a border appear around the section. It will be a solid line, 3 pixels in width and the color red.

### How to set custom values for the margins on a section

Sometimes you might want to have margins on the top, but not the bottom of a section, or vice versa. To override the margins in the settings you can use the following code:

```css
{
  margin-top: 0px;
  margin-bottom: 20px;
}
```

Include both of these lines of code if you want to change both the top and bottom margins. If you only want to change one of the margins, then you can delete the one you don't need.

One "gotcha" is that the margin will show up again on mobile, so in order to make sure that a margin is consistent on all screen sizes, you can add the same code in Mobile CSS OR add !important to the end of each (example below):

```css
{
  margin-top: 0px !important;
  margin-bottom: 20px !important;
}
```

### How to change the animation speed &#x20;

We have set a default speed of 0.5s for elements to animate in when that section comes into view on page scroll. Sometimes that can seem slow if you have a lot of blocks that are animating in. To adjust this, you can use the following CSS:

```css
[style*=--dsgn-pck-animate] {
  --dsgn-pck-animation-multiplier: 0.2s; 
}
```

^^ The value can be updated to 0.1s, 0.2s, 0.3s, 0.4s, etc. If you want to apply that animation speed to ALL the animations (instead of one section), you can add the following code to the Global Custom CSS in the app interface.

```css

.dsgn-pck__animation-applied [style*=--dsgn-pck-animate] {
  --dsgn-pck-animation-multiplier: 0.2s;
}
```

### How to control width of banner sections

Banner sections are full width by default, but if do not want them to stretch across the whole screen, you can use the following CSS snippet to control the width. This snippet doesn't use a class (eg. .dsgn-pck\_\_sizer) because it is applied to the [parent element.](#how-to-select-the-entire-section)

```css
{
  max-width: 1200px;
  width: 95%;
  margin: auto;
}
```

### Global CSS

* General custom CSS add globally to theme or all Design Packs

![](/files/nR8ad7qbtTAtdtX6FL8k)


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://design-packs.gitbook.io/docs/fundamentals/custom-css/basic-css-examples.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
