---
title: Parent Attributes
weight: 2
---
The `Menu` and `Link`, and `Html` classes also use the `ParentAttributes` trait, which allows you to add attributes to their parent elements (which are generally a `ul` or `li` tags) via `setParentAttribute` and `addParentClass`.
```php
Menu::new()
->add(Html::raw('')
->setParentAttribute('id', 'user-123')
->addParentClass('-has-avatar')
);
```
```html