English
German

CSS Border

CSS Border

CSS Border, our personal favorite CSS attribute, allow you to completely customize the borders that appear around HTML elements. With HTML, it used to be impossible to place a border around an element, except for the table. CSS Borders let you create crisp, customized border styles with very little work, compared to the antiquated methods of HTML.


Border Style Types

There are numerous types of border styles at your disposal. We recommend that you experiment with many color border-style combinations to get an idea of all the different looks you can create. Note: We have used CSS Classes below, so check out the CSS Classes lesson if you do not understand.

Example:

p.solid {border-style: solid; }
p.double {border-style: double; }
p.groove {border-style: groove; }
p.dotted {border-style: dotted; }
p.dashed {border-style: dashed; }
p.inset {border-style: inset; }
p.outset {border-style: outset; }
p.ridge {border-style: ridge; }
p.hidden {border-style: hidden; }

Output

CSS Tutorial

CSS Tutorial

CSS Tutorial

CSS Tutorial

CSS Tutorial

CSS Tutorial

CSS Tutorial

CSS Tutorial

CSS Tutorial

CSS Tutorial

This is probably obvious, but the default border-style setting for an element is hidden.


Border Width

To alter the thickness of your border use the border-width attribute. You may use key terms or exact values to define the border width
 

Example:

table { border-width: 7px;
border-style: outset; }
td { border-width: medium;
border-style: outset; }
p { border-width: thick;
border-style: solid; }
 

Output
css tutorial
html tutorial
learn javascript

high class tutorial hiscript


Border Color

Now for the creative aspect of CSS Borders! With the use of the border-color attribute, you will be able to create customized borders to fit the flow and layout of your website. Border colors can be any color defined by RGB, hexadecimal, or key terms. Below is an example of each of these types.

Example:

table { border-color: rgb( 100, 100, 255);
border-style: dashed; }

td { border-color: #FFBD32;
border-style: ridge; }

p { border-color: blue;
border-style: solid; }
 


Border direction

If you would like to place a border on only one side of an HTML element, or maybe have a unique look for each side of the border, then use border-(direction). The direction choices are of course: top, right, bottom, and left. CSS allows you to treat each side of a border separately from the other three sides. Each side can have its own color, width, and style set, as shown below.

Example:

p { border-bottom-style: dashed ;
border-bottom-color: yellow;
border-bottom-width: 5px; }

h4 { border-top-style: double;
border-top-color: purple;
border-top-width: thick; }

h5 { border-left-style: groove;
border-left-color: green;
border-left-width: 15px;
border-bottom-style: ridge;
border-bottom-color: yellow;
border-bottom-width: 25px; }
 

Output

Html Tutotial HTML example

CSS tutorial CSS example

High class tutorial available hiscript


Border All in One

While it is nice that CSS allows a web developer to be very specific in creating a customized border, sometimes it is just easier and less of a headache to create a uniform border, all in single line of CSS code. Most of the borders you see on Hiscript are created in this manner.

Example:

p { border: 20px outset blue ;}
h4{ border: 5px solid; }
h5{ border: dotted; }
 

Output

CSS tutorial

CSS Example

HTML tutorial learn hiscript


CSS Tutorial,CSS Border, CSS Border example, learn CSS Border,explain example CSS Border online free training CSS Tutorial, CSS Tutorial example, learn CSS Border, online tutorial, download tutorial, CSS Tutorial books, CSS Tutorial videos, live videos CSS Tutorial, learn CSS Tutorial, CSS Tutorial topic CSS Border, live training CSS Tutorial, download free tutorial