>> English << | česky | PortuguêsZVON > Tutorials > CSS2 tutorial
>> Example 16 << | Prev | Next | Index | Contents

Border width, style, and color can be given simultaneously using shorthand notation (1). Shorthands for margins also exist: (top&bottom - left&right), (top - left&right - bottom), or (top -right-bottom-left ) (2).

XML SourceCSS stylesheetExample link
(1)
     <AAA> |
          <BBB>bbb</BBB>|
          <CCC>ccc</CCC>|
     </AAA>

BBB {border: thick double red}
CCC {border-left: medium single green; border-bottom: thick double aqua;
border-right: thin dotted navy; border-top: medium groove olive}
View output
XML SourceCSS stylesheetExample link
(2)
     <AAA> |
          <BBB>bbb</BBB>|
          <CCC>ccc</CCC>|
     </AAA>

BBB {margin: 10px 5px}
CCC {margin: 10px 40px 30px}
View output