Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
[How-to] Multiple Borders around One 'DIV'
Old 07-21-2009, 09:07 PM [How-to] Multiple Borders around One 'DIV'
Skilled Talker

Posts: 54
Trades: 0
Mozilla / Firefox Only. Live preview borders.html


Why
-- Having multiple borders around things almost always makes them look
better. An example of such a thing would be an inner light - blue border
with an outer black border with a background of a medium - blue. --

How
-- You will need to use a simple CSS "5" --

What
-- You use a border "markup" that works in itself. Meaning if I wanted a
white outer border and a black inner border I would type something like --
#FFF #000;

Really, one div?
-- The example-source uses two divs, but the first one is specifically there
to center everything, it is completely un-necessary and is just there for an
added design point. One div ("BORDER") is all you really do need! --

Source
-- The source file will show a 2PX red, white and blue border with 4PX
spacer, which is "disguised" as the background color (#AAA), it can
also use the NONE specification. --

Code:
<html>
<head>
<title> HAVING ONE DIV WITH MULTIPLE BORDERS </title>
<style>
.BORDER {
    BORDER:12PX SOLID #AAA;
    -moz-border-bottom-colors:#F00 #F00 #AAA #AAA #AAA #FFF #FFF #AAA #AAA #AAA #00F #00F;
    -moz-border-right-colors:#F00 #F00 #AAA #AAA #AAA #FFF #FFF #AAA #AAA #AAA #00F #00F;
    -moz-border-left-colors:#F00 #F00 #AAA #AAA #AAA #FFF #FFF #AAA #AAA #AAA #00F #00F;
    -moz-border-top-colors:#F00 #F00 #AAA #AAA #AAA #FFF #FFF #AAA #AAA #AAA #00F #00F;
    PADDING:30PX 0PX 30PX 0PX;
    FONT-FAMILY:GEORGIA;
    TEXT-ALIGN:CENTER;
    OVERFLOW:HIDDEN;
    FONT-SIZE:13PX;
    WIDTH:200PX}
</style>
</head>

<body bgcolor="#AAAAAA">

<div align="center"> <br />
<div class="BORDER"> Textile </div>
</div>

</body>
</html>
--V-- COMMENTS --V--
Code:
<!-- The "FIRST" div is not needed, it is there to provide centering -->

<html>
<head>
<title> HAVING ONE DIV WITH MULTIPLE BORDERS </title>
<style>
.BORDER {
    BORDER:12PX SOLID #AAA;
    /* 12PX being the overall size of the border, you will need to "FILL" this up. */
    
    -moz-border-bottom-colors:#F00 #F00 #AAA #AAA #AAA #FFF #FFF #AAA #AAA #AAA #00F #00F;
    -moz-border-right-colors:#F00 #F00 #AAA #AAA #AAA #FFF #FFF #AAA #AAA #AAA #00F #00F;
    -moz-border-left-colors:#F00 #F00 #AAA #AAA #AAA #FFF #FFF #AAA #AAA #AAA #00F #00F;
    -moz-border-top-colors:#F00 #F00 #AAA #AAA #AAA #FFF #FFF #AAA #AAA #AAA #00F #00F;
    /* -------------- Outmost Borders ------- Middle Borders ------- Inmost Borders */
    /* ------ The sum of which equal "12" which is the first defined border width. */

    PADDING:30PX 0PX 30PX 0PX;
    FONT-FAMILY:GEORGIA;
    TEXT-ALIGN:CENTER;
    OVERFLOW:HIDDEN;
    FONT-SIZE:13PX;
    WIDTH:200PX}
</style>
</head>

<body bgcolor="#AAAAAA">

<!--  // NOT NEEDED //  -->
<div align="center"> <br />
<!--  // NOT NEEDED //  -->

<!--  // NEEDED - IS BORDER //  -->
<div class="BORDER"> Textile </div>
<!--  \\ NEEDED - IS BORDER \\  -->

<!--  \\ CLOSES CENTERING TAG \\ -->
</div>
<!--  \\ CLOSES CENTERING TAG \\ -->

</body>
</html>

Last edited by KellyAX; 07-21-2009 at 09:17 PM..
KellyAX is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-22-2009, 01:23 AM Re: [How-to] Multiple Borders around One 'DIV'
konetch's Avatar
Ultra Talker

Posts: 258
Trades: 0
You still can't ignore the fact that most people are using IE according to http://en.wikipedia.org/wiki/Usage_s...f_web_browsers

This means that you're cuttin out over half of the people from seeing the design you wan't them to.
__________________
Alex
konetch is offline
Reply With Quote
View Public Profile
 
Old 07-22-2009, 05:53 PM Re: [How-to] Multiple Borders around One 'DIV'
Super Moderator

Posts: 1,576
Location: Kokkola, Finland
Trades: 1
it's not such a great effect though is it if you're honest
davemies is online now
Reply With Quote
View Public Profile Visit davemies's homepage!
 
Old 07-23-2009, 01:44 AM Re: [How-to] Multiple Borders around One 'DIV'
konetch's Avatar
Ultra Talker

Posts: 258
Trades: 0
Quote:
Originally Posted by davemies View Post
it's not such a great effect though is it if you're honest

you could probably achieve some cool gradients though without having to create images, but it is a lot more coding.
__________________
Alex
konetch is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to [How-to] Multiple Borders around One 'DIV'
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.42312 seconds with 12 queries