...

View Full Version : Text in border



devillion
02-12-2005, 03:05 PM
Is there any way i can force my text to be in the border i am putting around a div area?

This is what i want it to look like, pardon my crappy msp drawing :P

http://img.photobucket.com/albums/v470/devillion/untitled6.bmp

rmedek
02-12-2005, 03:15 PM
Like this perhaps?


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Untitled</title>
<style type="text/css">

#content {
padding: 1em;
position: relative;
border: solid 1px #000;
}

h2 {
position: absolute;
top: -1.9em;
left: 50%;
margin-left: -2em;
padding: .5em;
background: #fff;
}

</style>
</head>
<body>
<h1>text effect</h1>
<div id="content">
<h2>content</h2>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in </p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in </p>
</div>
</body>
</html>


<legend> and <fieldset> also work together to produce the same effect, but I think they are reserved in the "semantic structure" for forms (could be wrong)...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum