There is no specific element for parentheses.
In some cases the small
element might be appropriate.
You have to use the punctuation marks (e.g., the round brackets (
and )
) explicitly as part of the HTML (so not included via CSS content
).
If you want to be able to style the whole parenthesis resp. the brackets, you should use span
elements, as they don’t have any meaning. For example:
<p>At vero eos duo <span class="parenthesis">(consetetur sadipscing elitr)</span> dolores et ea rebum.</p>
<p>At vero eos duo <span class="parenthesis-start">(</span>consetetur sadipscing elitr<span class="parenthesis-end">)</span> dolores et ea rebum.</p>
Now you could visually hide the brackets and add other punctuation marks (or similar) via CSS’s ::after
and ::before
pseudo-elements.