Applying a Border to a Single Side

PropertyDescription Values
border-top-widthDefines the top border, check border-width for its value
border-top-styleDefines the top border, check border-style for its value
border-top-colorDefines the top border, check border-color for its value
border-bottom-widthDefines the bottom border, check border-width for its value
border-bottom-styleDefines the bottom border, check border-style for its value
border-bottom-colorDefines the bottom border, check border-color for its value
border-left-widthDefines the left border, check border-width for its value
border-left-styleDefines the left border, check border-style for its value
border-left-colorDefines the left border, check border-color for its value
border-right-widthDefines the right border, check border-width for its value
border-right-styleDefines the right border, check border-style for its value
border-right-colorDefines the right border, check border-color for its value
 
<!DOCTYPE HTML> 
<html> 
    <head> 
        <title>Example</title> 
        <style type="text/css"> 
        p { 
            border-width: 5px; 
            border-style: solid; 
            border-color: black; 
            border-left-width: 10px; 
            border-left-style: dotted; 
            border-top-width: 10px; 
            border-top-style: dotted; 
        } 
        </style> 
    </head> 
    <body> 
        <p> 
            HyperText Markup Language (HTML) is the main markup language for 
            displaying web pages and other information that can be displayed 
            in a web browser(From From Wikipedia, the free encyclopedia).
        </p> 
    </body> 
</html>
  
Click to view the demo
Home 
  HTML CSS Book 
    CSS  

Related: