How do i create a simple blue border?

Discussion in 'HTML & Website Design' started by robs132, Nov 2, 2009.

  1. #1
    Hey guys,

    I'm trying to create a simple blue border in dreamweaver like the one displayed here:

    www.stopfibroids.com

    this is the code I am currently using:

    body {
    background-image: url(r_border.jpg)top center no-repeat;
    background-repeat: no-repeat;
    margin-left: 0px;
    margin-right: 0px;
    padding-right: 0px;
    }

    How do I do this?

    Thank you!!
     
    Last edited: Nov 2, 2009
    robs132, Nov 2, 2009 IP
  2. drawer

    drawer Peon

    Messages:
    236
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The page you found is much more complicated than you think - its using sliced images as a background, its not just a simple border using CSS.
     
    drawer, Nov 2, 2009 IP
  3. robs132

    robs132 Peon

    Messages:
    112
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    is there an alternative besides using a complicated method?
     
    robs132, Nov 2, 2009 IP
  4. xira

    xira Active Member

    Messages:
    315
    Likes Received:
    8
    Best Answers:
    4
    Trophy Points:
    68
    #4
    xira, Nov 3, 2009 IP
  5. robs132

    robs132 Peon

    Messages:
    112
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hey xira thanks for the link.

    BTW just clicked through your signature and home on the xira webpage has a typo! I think it should read 'company' not 'comany'
     
    robs132, Nov 3, 2009 IP
  6. forex4noobs

    forex4noobs Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    hey it's actually pretty easy to accomplish (I use divs)

    1. In photoshop use the rounded corner tool to create a round cornered box the size of the site. The site you linked to is roughly 790px wide so set the rounded corner tool to 790px wide.

    The box has to be created on a new layer.

    2. Ctrl + Click the layer with the box to select it. When its selected up the top go to Select > Modify > Contract and contract it to whatever width you want your border to be.

    3. Now that the selection is contracted hit crtl+x to remove the new selection and your left with something like this...

    [​IMG]

    4. Now simply join the border layer and the background layer then select the top part of the image. select from the top border to the bottom of the top rounded corners. Ctrl+C the selection open a new photoshop canvas and paste it in. Save it as something like bordertop.gif vertically flip the image and save it again as borderbottom.gif

    top:
    [​IMG]

    bottom:
    [​IMG]

    5. Now you have your images just throw in the CSS

    
    .border-top {
    background:url(../imgs/bordertop.gif) no-repeat;	
    width:790px; height:25px;
    }
    
    .border-bottom {
    background:url(../imgs/borderbottom.gif) no-repeat;	
    width:790px; height:25px;
    }
    
    .border-content{
    width:760px; padding:0 10px;  
    border-left:solid 5px #aec5ea; border-right:solid 5px #aec5ea; 
    }
    
    
    Code (markup):

    
    <div class="border-top"></div>
    <div class="border-content">
    blah blah blah blah site content here
    </div>
    <div class="border-bottom"></div>
    
    Code (markup):
    If you want the text higher into the top border just make the top border image higher and change the css

    [​IMG]

    
    .border-top {
    background:url(../imgs/bordertop.gif) no-repeat;	
    width:790px; height:80px; padding-top:10px;
    }
    
    rest of css as above
    
    Code (markup):
    
    <div class="border-top">
    Heading
    </div>
    <div class="border-content">
    blah blah blah blah site content here
    </div>
    <div class="border-bottom"></div>
    
    Code (markup):
     
    forex4noobs, Nov 3, 2009 IP
  7. akash222

    akash222 Peon

    Messages:
    568
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Mine suggestion for you that use photo shop its the best way to create graphics and best border with attractive looks.
     
    akash222, Nov 3, 2009 IP
  8. robs132

    robs132 Peon

    Messages:
    112
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    thanks for that forex4noobs I will give it a run through when I get home tonight.
     
    robs132, Nov 3, 2009 IP
  9. forextrendalerts

    forextrendalerts Guest

    Messages:
    132
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0