古いWebブラウザでも表示できる方式です。
.BorderShadowLetterStyle {
margin: 0;
font-size: 4rem;
font-weight: 700;
color: #ffbfdc;
text-shadow: 0 2px 0 #c30058, 2px 0 0 #c30058, 0 -2px 0 #c30058, -2px 0 0 #c30058,2px 2px 0 #c30058, -2px 2px 0 #c30058, -2px -2px 0 #c30058, 2px -2px 0 #c30058;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link rel="stylesheet" href="BorderLetterTextShadow.css"/>
</head>
<body>
<h1>縁取り文字のデモ</h1>
<p class="BorderShadowLetterStyle">縁取り文字です</p>
</body>
</html>
.BorderShadowLetterStyle {
margin: 0;
font-size: 4rem;
font-weight: 700;
color: #ffbfdc;
text-shadow: 2px 2px 0 #c30058, -2px 2px 0 #c30058, -2px -2px 0 #c30058, 2px -2px 0 #c30058;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link rel="stylesheet" href="BorderLetterTextShadow.css"/>
</head>
<body>
<h1>縁取り文字のデモ</h1>
<p class="BorderShadowLetterStyle">縁取り文字です</p>
</body>
</html>
.BorderLetterStyleTextStroke {
margin: 0;
font-size: 4rem;
font-weight: 700;
color: #afffee;
-webkit-text-stroke-width: 2px;
-webkit-text-stroke-color: #0094ff;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link rel="stylesheet" href="BorderLetter.css"/>
</head>
<body>
<h1>縁取り文字のデモ</h1>
<p class="BorderLetterStyleTextStroke">縁取り文字です</p>
</body>
</html>
-webkit-text-stroke-color
で指定しています。 -webkit-text-stroke-width: 2px;
-webkit-text-stroke-color: #0094ff;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<h1>SVGによる縁取り文字のデモ</h1>
<svg xmlns="http://www.w3.org/2000/svg" width="600" height="80" viewBox="0 0 600 80" preserveAspectRatio="xMinYMid">
<text x="12" y="50%" dy="0.4em" dominant-baseline="alphabetic" letter-spacing="11" font-weight="bold" font-size="60" font-family="Meiryo" fill="#0b7e51" stroke-width="8" stroke="#0b7e51" stroke-linejoin="round">縁取り文字です</text>
<text x="12" y="50%" dy="0.4em" dominant-baseline="alphabetic" letter-spacing="11" font-weight="bold" font-size="60" font-family="Meiryo" fill="#96df9c" stroke-width="0">縁取り文字です</text>
</svg>
</body>
</html>
<svg xmlns="http://www.w3.org/2000/svg" width="600" height="80" viewBox="0 0 600 80" preserveAspectRatio="xMinYMid">
</svg>
stroke-width="8"
を設定し外側の縁取り文字列を描画します。
もう一方は、stroke-width="0"
を設定し内側の文字列を描画します。 <text x="12" y="50%" dy="0.4em" dominant-baseline="alphabetic" letter-spacing="11" font-weight="bold" font-size="60" font-family="Meiryo" fill="#0b7e51" stroke-width="8" stroke="#0b7e51" stroke-linejoin="round">縁取り文字です</text>
<text x="12" y="50%" dy="0.4em" dominant-baseline="alphabetic" letter-spacing="11" font-weight="bold" font-size="60" font-family="Meiryo" fill="#96df9c" stroke-width="0">縁取り文字です</text>