Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Jun 2007
    Posts
    805
    Thanks
    123
    Thanked 23 Times in 23 Posts

    Picture as border?

    Hi!

    I just came to wonder if you can use a picture (repeating) as a border around ie a div instead of just a color? If so, how?

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Yes but only in browsers that support that CSS3 option such as Firefox 4, Internet Explorer 15 etc.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #3
    Regular Coder
    Join Date
    Jun 2007
    Posts
    805
    Thanks
    123
    Thanked 23 Times in 23 Posts
    Ah okay, thanks! Then I'll wait for better times to come, lol.

  • #4
    Regular Coder kosstr12's Avatar
    Join Date
    Apr 2007
    Location
    Woodstock, Georgia
    Posts
    428
    Thanks
    7
    Thanked 5 Times in 5 Posts
    I dont believe you would get any problems if you went ahead and put it up, and simply had an alternate option for the people with old versions of browsers...?

  • #5
    Regular Coder
    Join Date
    May 2006
    Posts
    290
    Thanks
    6
    Thanked 14 Times in 14 Posts
    Not sure if this is want your mean but I am using a similar effect on a test template.

    The trick is to make it seem like a border when its really just a div with padding and then another div inside it.

    For instance:

    Code:
    .rc1_outerbody {
    width:524px;
    margin:5px 0px 15px 0px;
    padding:5px;
    border:1px solid #69C;
    background:#036 url(images/repeating_pix.png);
    }
    .rc1_innerbody {
    width:512px;
    padding:5px;
    font-size:125%;
    line-height:125%;
    border:1px solid #69C;
    background:#69C ;
    }
    All this does is create a block element with with a padding of 5px on all sides. Just make the background a repeating image and you can achieve the same effect. If you want a smaller border just decrease the padding, larger just increase the padding.

    -trigger

  • #6
    Senior Coder timgolding's Avatar
    Join Date
    Aug 2006
    Location
    Southampton
    Posts
    1,519
    Thanks
    114
    Thanked 110 Times in 109 Posts
    I suggest making a block of nine divs. 3 by 3 and then either repeating through all expect the middle or having separate pictures for the outer ones
    You can not say you know how to do something, until you can teach it to someone else.

  • #7
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Check out the example I made for someone a while back
    Border-Image Help
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •