+ Reply to Thread
Results 1 to 7 of 7

Thread: Custom Image Borders with CSS?

  1. #1
    Zdroyd's Avatar
    Zdroyd is offline x10 Elder Zdroyd is an unknown quantity at this point
    Join Date
    Feb 2008
    Location
    Playing Halo
    Posts
    548

    Custom Image Borders with CSS?

    Is it possible to use CSS to make a custom boarder that uses an image file for the line?

    And can this also be used to make rounded corners?

    Thank you ahead of time...

  2. #2
    freecrm's Avatar
    freecrm is offline x10 Elder freecrm is an unknown quantity at this point
    Join Date
    May 2008
    Location
    UK
    Posts
    629

    Re: Custom Image Borders with CSS?

    Quote Originally Posted by Zdroyd View Post
    Is it possible to use CSS to make a custom boarder that uses an image file for the line?

    And can this also be used to make rounded corners?

    Thank you ahead of time...
    In direct answer to your question... yep.

    The way image borders are created is to position images (in css) relatively within <div>'s, not customising the border itself.

    However, it gets a bit tricky as each div can only load one image, so you have to set a div within a div within a div etc. (unless someone can tell me otherwise)

    And yes, this is the way I do rounded corners. I use a block with a plain colour background and then create rounded .jpg corners in that background colour (with white on the outside)

  3. #3
    Zdroyd's Avatar
    Zdroyd is offline x10 Elder Zdroyd is an unknown quantity at this point
    Join Date
    Feb 2008
    Location
    Playing Halo
    Posts
    548

    Re: Custom Image Borders with CSS?

    ... So can anyone tell me how to do it?

    It will be very helpful for me to know...

    (Note that I do not have to have rounded corners, I really just need ANY way to make a image boarder for tables.)

  4. #4
    sourfacedcyclop's Avatar
    sourfacedcyclop is offline x10 Sophmore sourfacedcyclop is an unknown quantity at this point
    Join Date
    Sep 2007
    Posts
    221

    Re: Custom Image Borders with CSS?

    You could load the image you want inside of another, larger image with rounded corners, this would give the illusion of rounded corners and custom borders. It might look something like this.
    Code:
    div#table1 table tr td {
    background:url('imageinbghere') no-repeat;
    width:whatever;
    height:whatever;
    }
    div#table1 table tr td img {
    position:relative;
    width:whatever;
    height:whatever;
    }
    Last edited by sourfacedcyclop; 01-07-2009 at 03:11 PM.

  5. #5
    Zdroyd's Avatar
    Zdroyd is offline x10 Elder Zdroyd is an unknown quantity at this point
    Join Date
    Feb 2008
    Location
    Playing Halo
    Posts
    548

    Re: Custom Image Borders with CSS?

    So everyone is telling me that it is not possible to simply have the borders drawn with an image?

    Something like:
    <table top_border = "/borderfile.jpg" bottom_border = "/border2file.jpg" />
    Last edited by Zdroyd; 01-08-2009 at 08:58 AM.

  6. #6
    alz4445 is offline x10 Sophmore alz4445 is an unknown quantity at this point
    Join Date
    Sep 2008
    Posts
    124

    Re: Custom Image Borders with CSS?

    No. You can't do it like that.
    Code:
    <div class="left"></div>
    <div class="top"></div>
    <div class="mid">content</div>
    <div class="right"></div>
    <div class="bot"></div>
    And in CSS set all of them to float left, and set the background images as the images you want around the outside, in bot, left, right and top. Mid for the middle etc.

    With tables, just add another 2 rows, and 2 columns. In the top left corner, add the rounded edge, the same for all of the other corners, and you get the picture for the top/bottom and left/right.
    Last edited by alz4445; 01-08-2009 at 09:21 AM.


  7. #7
    Zdroyd's Avatar
    Zdroyd is offline x10 Elder Zdroyd is an unknown quantity at this point
    Join Date
    Feb 2008
    Location
    Playing Halo
    Posts
    548

    Re: Custom Image Borders with CSS?

    But it will not custom strech when I have the tables size be a %.

    I suppose that is alright, I will just change my idea to make it so I do not have to have borders. *cry*

    Thank you all for the help...

+ Reply to Thread

Similar Threads

  1. Free Software Poll 5: Image Editors
    By Kayos in forum Computers & Technology
    Replies: 10
    Last Post: 01-16-2009, 06:42 PM
  2. Internet borders
    By Zangetsu in forum Crossfire
    Replies: 7
    Last Post: 06-20-2008, 10:36 AM
  3. Custom Userbars for credits!
    By DeadBattery in forum The Marketplace
    Replies: 3
    Last Post: 04-20-2008, 09:21 AM
  4. errors while attaching
    By mattspec in forum Feedback and Suggestions
    Replies: 0
    Last Post: 12-19-2005, 01:50 PM
  5. November Desktop
    By n4tec in forum Off Topic
    Replies: 12
    Last Post: 11-08-2005, 07:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers