Website Design Codes

Discussion in 'Web Design & Coding' started by Bman, Nov 7, 2007.

  1. Bman

    Bman OSNN Veteran Original

    Messages:
    8,799
    Location:
    Ottawa, Ontario
    See the outlined border, how do you code something like that?

    So that it stretches when you ad text and images to it...
     
    Last edited: Dec 19, 2007
  2. muzikool

    muzikool Act your wage. Political User

    If you're coding in CSS then it should be pretty easy. Sometimes sites like that that have "shadows" around the container are actually using images for the top and bottom, along with repeating images for the rest of the container.

    In your example you would have a 1px tall image that is the width of the container plus some extra on either end. The left and right ends of the image would have the blue background color and gray border, and the middle would be the greenish brown color of the container. This image would repeat down the page as much as needed for the content to fit. The top and bottom of the container would be separate images with the border added to the top or bottom of the image. Using DIVs you would code this into a stylesheet.
     
  3. Bman

    Bman OSNN Veteran Original

    Messages:
    8,799
    Location:
    Ottawa, Ontario
    I wouldn't know how to code that, I am doing this website to basically learn and get better at html and css.

    What would I put into the css sheet, got a template or a beginning for me?
     
  4. j79zlr

    j79zlr Glaanies script monkey Political User

    Messages:
    2,725
    Location:
    Chicago
  5. American Zombie

    American Zombie Moderator Staff Member Political User

    Messages:
    2,932
    Location:
    Seattle
  6. Bman

    Bman OSNN Veteran Original

    Messages:
    8,799
    Location:
    Ottawa, Ontario
    Ok, forget all that.

    I have a bunch of links (the menu), and a banner (just a box) on the top.

    I want the banner to change images, when someone hovers over the links.


    How is this done?

    I'm writing in XHTML & CSS.
     
  7. muzikool

    muzikool Act your wage. Political User

    That will probably require JavaScript. You learning that as well?
     
  8. AllWeatherGal

    AllWeatherGal Not Just for Fair Weather Political User Folding Team

    Messages:
    253
    Location:
    SF Bay Area
    an excellent javascript library for you (and everyone):

    http://simplythebest.net/scripts/DHTML_scripts/

    I'm sure there's a script in there that'll do what you want. I've found scripts in there to be very easy to use/implement, robust, and well-designed.

    Just, please ... give the authors credit in your code.

    And oh... you'll probably need to add the js in "code" mode rather than "design" ... I've only used scripts from here when hand-coding.
     
    muzikool likes this.
  9. dubstar

    dubstar format c:

    Messages:
    1,357
    Location:
    Southern California
    or, you can make it in to a link, and change the background in CSS for when the mouse is over it.

    a:link {background:bird.jpg;} --- this is what it looks like with no activity
    a:hover {background:dog.jpg;} --- when the mouse is over it
    a:focus {background:dog.jpg;} ---- when someone uses the tab key to move around (mostly used for accessability.)
    a:active {background:none;} --- when the mouse is clicked down.
    a:visited {background:bird.kpg;}