CSS » Double Borders
A while ago, I was looking for a way to implement double borders in my layout, without the use of images. It can be done with just two DIVs, CSS and a little patience. It works in both IE and Firefox.First DIV
First, we have to make the DIV to which we will add a border, a background colour and some padding.
#div1 {
border: 5px solid #494949;
background: #dddddd;
padding: 5px;
width: 50%;
height: 200px;
margin: 10px auto;
}
<div id="div1"> </div>
That produces this:
Second DIV
Now all we have to do is add the DIV that we want to have a double border, inside the first div.
#div2 {
background: #494949;
padding: 5px;
font: bold 1em/1.7em Tahoma, sans-serif;
color: #dddddd;
height: 180px;
}
<div id="div1">
<div id="div2">
This is a double bordered DIV.
</div>
</div>
Now, we have this:
This is a double bordered DIV. I'm going to fill up this space with some nonsense to make the text wrap. I wonder if I can find some pig latin somewhere... Ellohay. Isthay isway away oubleday orderedbay IVDAY. Oh, that really is interesting
Lets try out my translator widget. "Hello! How are you?" in Dutch is apparently "Hello! Hoe bent u?". I thought it was "Hoe gaat het". And I thought "Hello" was spelt "Hallo". Hmm. Well, I don't speak Dutch very well, so I wouldn't know
Comments
-
Maria
On December 29, 2007 at 3:46 pm.Ah, translators. Don’t we love them? I’m a native speaker dutch and you’re right: ‘hello, how are you?’ means ‘hallo, hoe gaat het?’ or ‘hallo, hoe gaat het met jou?’ And at http://www.lipsum.com you can find some rubish text to fill spaces.
It’s a nice tutorial! I’m trying to make a cat-website only with div-layers. I’ll keep this in mind if I decide to use double-border layers.
RSS feed for comments on this post. TrackBack URI