border in text css code example

Example 1: how to make border for letters in css

h1 {
    /* 1 pixel black shadow to left, top, right and bottom */
    text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;

    font-family: sans; color: yellow;
}

Example 2: text border css

h1 {
  -webkit-text-stroke: 1px black;
}

Example 3: border for text in html

/*All types of border*/
p.dotted {border-style: dotted;}
p.dashed {border-style: dashed;}
p.solid {border-style: solid;}
p.double {border-style: double;}
p.groove {border-style: groove;}
p.ridge {border-style: ridge;}
p.inset {border-style: inset;}
p.outset {border-style: outset;}
p.none {border-style: none;}
p.hidden {border-style: hidden;}
p.mix {border-style: dotted dashed solid double;}

Example 4: how to make a text with a border in css

h1{
    width:30px;
    margin-top:-10px;
    margin-left:5px;
    background:white;
}

/* Change the values to achieve what design you want */

Tags:

Css Example