# Adding HTML attributes to Scribble \`subsubsection\`

**URL:** <https://racket.discourse.group/t/adding-html-attributes-to-scribble-subsubsection/1296>\
**Category:** Questions & Answers\
**Tags:** scribble, style\
**Created:** [September 11, 2022, 6:56pm UTC](https://racket.discourse.group/t/adding-html-attributes-to-scribble-subsubsection/1296 "2022-09-11T18:56:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sschwarzer](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/sschwarzer/32/1940_2.png) [@sschwarzer](https://racket.discourse.group/u/sschwarzer)\
**Post date:** [September 11, 2022, 6:56pm UTC](https://racket.discourse.group/t/adding-html-attributes-to-scribble-subsubsection/1296/1 "2022-09-11T18:56:44Z")

</div>

In a Scribble document, I'm using [subsubsection](https://docs.racket-lang.org/scribble/base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._subsubsection%29%29), but don't want numbering - and the line above the title.

If I add `style="border: none; padding-top: 0px; margin-top: 1em;"` to the generated HTML in the `h5` tag, this has the wanted effect.

I've read about styles what I could find in the Scribble documentation and [this section](https://docs.racket-lang.org/scribble/extra-style.html) seems to be the closest to what I want.

In my Scribble document, I have

```scheme
@(define (entry-subsection text)
   (subsubsection
     #:style
       (style
         #f
         (list 'unnumbered
               ; (alt-tag "h5")
               (attributes '((style . "border: none; padding-top: 0px; margin-top: 1em;")))))
   text))

```

and

```scheme
@entry-subsection{``Technical'' number types}

```

but the custom style information isn't included in the generated HTML. (The `'unnumbered` style _is_ applied, though.) I've tried the code with and without the `(alt-tag "h5")`.

Do you have any suggestions on how to get the custom style information included?

---

<div class="post-metadata">

**Author:** ![sschwarzer](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/sschwarzer/32/1940_2.png) [@sschwarzer](https://racket.discourse.group/u/sschwarzer)\
**Post date:** [September 18, 2022, 5:57pm UTC](https://racket.discourse.group/t/adding-html-attributes-to-scribble-subsubsection/1296/2 "2022-09-18T17:57:30Z")

</div>

There seems to be a bug in `subsubsection`. (The above code works with `elem`.)

I entered a Scribble issue:

> <https://github.com/racket/scribble/issues/352>
>
> The following Scribble file,
> \`\`\`
> \#lang scribble/manual
> 
> @(require
> scribb…le/html-properties
> scribble/core)
> 
> @(define red-style
> (make-style #f (list (attributes '((style . "color: red"))))))
> 
> @elem\[#:style red-style\]{red elem}
> @section\[#:style red-style\]{red section}
> @subsection\[#:style red-style\]{red subsection}
> @subsection\[#:style red-style\]{red subsubsection}
> \`\`\`
> is supposed to display all the text in the \`elem\` and \`\*section\`s in red.
> 
> However, the style isn't applied to the \`\*section\`s. The HTML is
> \`\`\`
> ...
> \<p\>\<span style="color: red"\>red elem\</span\>\</p\>
> \<h3\>1\<tt\>&nbsp;\</tt\>\<a name="(part.\_red\_section)"\>\</a\>red section\</h3\>
> \<h4\>1.1\<tt\>&nbsp;\</tt\>\<a name="(part.\_red\_subsection)"\>\</a\>red subsection\</h4\>
> \<h5\>1.1.1\<tt\>&nbsp;\</tt\>\<a name="(part.\_red\_subsubsection)"\>\</a\>red subsubsection\</h5\>
> ...
> \`\`\`
> 
> This problem might also occur for other functions apart from \`\*section\`.

---

<div class="post-metadata">

**Author:** ![sschwarzer](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/sschwarzer/32/1940_2.png) [@sschwarzer](https://racket.discourse.group/u/sschwarzer)\
**Post date:** [September 19, 2022, 11:10am UTC](https://racket.discourse.group/t/adding-html-attributes-to-scribble-subsubsection/1296/3 "2022-09-19T11:10:41Z")

</div>

Given the described bug, it's currently impossible to add a style attribute to a subsubsection. _However_, it's possible to go the other way around and add an `alt-tag` property to an [`elem`](https://docs.racket-lang.org/scribble/base.html#%28def._%28%28lib._scribble%2Fbase..rkt%29._elem%29%29)/[`element`](https://docs.racket-lang.org/scribble/core.html#%28def._%28%28lib._scribble%2Fcore..rkt%29._element%29%29).

Therefore, my workaround now is:

```scheme
@(define entry-subsection-style
   (make-style
     #f
     (list (alt-tag "h5")
           (attributes '((style . "border: none;
                                   padding-top: 0px;
                                   margin-top: 1em;
                                   font-size: 1.4rem;"))))))

@(define (entry-subsection text)
   (elem #:style entry-subsection-style text)))

```
