Borders
Use border utilities to quickly style the border and border-radius of an element.
Borders
Use border utilities to add or remove an element’s borders. Choose from all borders or one at a time.
border
border-top
border-end
border-bottom
border-start
<ph outputclass="border">...</ph>
<ph outputclass="border-top">...</ph>
<ph outputclass="border-end">...</ph>
<ph outputclass="border-bottom">...</ph>
<ph outputclass="border-start">...</ph>
Border Specialization
The @border and @rounded attributes provide a semantic way to add borders and rounded corners.
Bordered Section
This section has a border.
This div has a border and rounded corners.
Bordered Card
This card has an explicit border and rounded corners.
<section border="yes" padding="2">
<title>Bordered Section</title>
<p>This section has a border.</p>
</section>
<div border="yes" rounded="yes" padding="2" margin="2">
<p>This div has a border and rounded corners.</p>
</div>
<card border="yes" rounded="yes" margin="2" width="50">
<title>Bordered Card</title>
<p>This card has an explicit border and rounded corners.</p>
</card><section outputclass="border p-2">
...
</section>
<div outputclass="border rounded p-2 m-2">
...
</div>
<section outputclass="card border rounded m-2 w-50">
...
</section>Frame attribute support
For DITA elements which support the @frame attribute, such as <lines>
and <codeblock>, additional frame borders are automatically added as shown:
// Simple C++ program to display "Hello World" // Header file for input output functions #include<iostream> using namespace std; // main function - // where the execution of program begins int main() { // prints hello world cout<<"Hello World"; return 0; }
Shall I compare thee to a summer’s day?
Thou art more lovely and more temperate:
Rough winds do shake the darling buds of May,
and summer’s lease hath all too short a date:
...
| Animal | Gestation |
|---|---|
| Elephant (African and Asian) | 19-22 months |
| Giraffe | 15 months |
| Rhinoceros | 14-16 months |
| Hippopotamus | 7 1/2 months |
<codeblock frame="sides">...</codeblock>
<lines frame="topbot" outputclass="bg-secondary-subtle p-3 border rounded">...</lines>
<table frame="all">...</table>