NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Webmaster Tutorials
Reload this Page Graphic borders around HTML blocks

Webmaster Tutorials Instructional webmaster-related how-to's and tutorials.

Advanced Search
2 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 10-13-2007, 03:34 AM THREAD STARTER               #1 (permalink)
NamePros Member
 
RaptorRex's Avatar
Join Date: Dec 2004
Posts: 93
RaptorRex is an unknown quantity at this point
 



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.
RaptorRex is offline  
Old 10-13-2007, 04:24 AM   #2 (permalink)
I'll do it
 
-Nick-'s Avatar
Join Date: Dec 2005
Location: India
Posts: 6,939
-Nick- Has achieved greatness-Nick- Has achieved greatness-Nick- Has achieved greatness-Nick- Has achieved greatness-Nick- Has achieved greatness-Nick- Has achieved greatness-Nick- Has achieved greatness-Nick- Has achieved greatness-Nick- Has achieved greatness-Nick- Has achieved greatness-Nick- Has achieved greatness
 


Member of the Month
September 2007
Adoption
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
-Nick- is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


 
All times are GMT -7. The time now is 11:24 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger