--- title: Appending and Prepending Html weight: 3 --- You can append and prepend html outside of the `ul` tag with similarly named functions. This is useful for submenu titles or separators. ```php Menu::new() ->prepend('

Title

') ->add(Link::to('/title/subpage', 'Subpage')) ->append('
'); ``` ```html

Title


``` If you only want to add html in certain conditions, you can use `appendIf` and `prependIf`. ```php $displayTitles = false; $displayRulers = true; Menu::new() ->prependIf($displayTitles, '

Title

') ->add(Link::to('/title/subpage', 'Subpage')) ->appendIf($displayRulers, '
'); ``` You can also wrap the menu in an element. ```php Menu::new()->wrap('div', ['class' => 'nav']); ``` ```html ```