| | |||||
| ||||||||
| Webmaster Tutorials Instructional webmaster-related how-to's and tutorials. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Member Join Date: Dec 2004
Posts: 93
![]() | Graphic borders around HTML blocks Recently I had to jazz up my default templates and thought hard about how to make graphic borders easy for anyone to implement. Here is the solution I came up with. It is the easiest method I can think of but I wonder what other techniques people are using. For example, imagine a comment box and you want a pretty shadowed border around it. There are 2 conditions on this: 1) the verticle size is variable since you don't know how large a comment someone wants to leave. 2) The horizontal size is fixed. The page designer decides that. Solution: 3 div blocks: header, body, footer. The left and right borders are comprised of the background of the body where left/right padding is used so text doesn't cover the border. <div class='header'></div> <div class='body'>comment here</div> <div class='footer'></div> div.header { width: 100px; background-image: url(h.png); height: 10px; } div.body { width: 80px; padding: 10px; background-image: url(b.png); } div.footer { width: 100px; background-image: url(f.png); height: 10px; } ????: NamePros.com http://www.namepros.com/webmaster-tutorials/384278-graphic-borders-around-html-blocks.html The key to this method is that the left and right borders are actually shown through the left and right padding of the body div, not in their own divs. Notice the width and padding of the body div compensates for this. This solution leaves things pretty easy to allow css to completely control whether or not the block has a border at all, and what it will look like. |
| |
| | #2 (permalink) |
| I'll do it ![]() Join Date: Dec 2005 Location: India
Posts: 6,939
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Nice tutorial ![]() Thanks for sharing it. It was pretty nice idea. I still remember the days when I used to put in Table and then put the images for the border of a block ![]() This one is rather neat
__________________ |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |