CodeLab
Tutorials For Everyone
Run
<!Doctype HTML> <html> <head> <title>CSS Borders Width</title> <style> .border-1 { border-style: solid; border-width: 5px; padding: 10px; margin: 10px; text-align: center; } .border-2{ border-style: dashed; border-width: 2px 10px 4px 20px; padding: 10px; margin: 10px; text-align: center; } .border-3{ border-style: solid; border-width: thin; padding: 10px; margin: 10px; text-align: center; } .border-4{ border-style: solid; border-width: medium; padding: 10px; margin: 10px; text-align: center; } .border-5{ border-style: solid; border-width: thick; padding: 10px; margin: 10px; text-align: center; } </style> </head> <body> <h2>CSS Border Width</h2> The border width property defines the width of border. Border style must be declared before border-width. <p class="border-1">Width of border is 5px.</p> <p class="border-2">All four border widths are different.</p> <p class="border-3">Border width is thin.</p> <p class="border-4">Medium border width.</p> <p class="border-5">Thick border width.</p> </body> </html>