3D effects in 2D computer displays are mere optical effects accomplished by the use of colour: lighter variations suggest bright (higher areas) and darker variations suggest shadown (lower areas). Most people is right-handed and writing lights tend to be on the left side of the desktop, so you use an imaginary source of light in the left top corner of the screen.
It's been possible to do it with pure CSS in rectangular areas for years:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head><title></title>
<meta name="Author" content="Softeca Internet">
<style type="text/css"><!--
body{
background-color: #8080C0;
}
div{
margin: 1em;
padding: 1em;
width: 25%;
color: white;
background-color: #8080C0;
}
div.outset{
border-width: 1px;
border-style: solid;
border-color: #A6A6D2 #4D4D9B #4D4D9B #A6A6D2;
}
div.inset{
border-width: 1px;
border-style: solid;
border-color: #4D4D9B #A6A6D2 #A6A6D2 #4D4D9B;
}
--></style>
</head>
<body>
<div class="inset">Lorem ipsum dolor sit amet, consectetur adipisicing elit</div>
<div class="outset">Lorem ipsum dolor sit amet, consectetur adipisicing elit</div>
</body>
</html>
Fonts, however, require newer CSS attributes that don't have wide support yet and, also, do not allow to provide more than one colour, so it's common to use images. See http://www.quirksmode.org/css/textshadow.html