Change background color when linking to an image

Discussion in 'Web Design and Development' started by blaklaybul, Dec 5, 2008.

  1. blaklaybul macrumors regular

    blaklaybul

    Joined:
    Aug 29, 2007
    Location:
    New York City
    #1
    Im working on a simple dreamweaver site and I want to know how to change the background color of the html pages that open when I have a image linked.

    I dont want to have a make a separate html page for each image and then modify that page...
    Is there a simpler way?
     
  2. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    The background color on pages when you're viewing an image directly is controlled at the browser level, not the design level. Just check your browser preferences and you'll find it.

    Another option you have is to use JavaScript to view the image on the current page. See any of the LightBox clones for examples as to how this works. Likely you've already seen it in action on other sites.
     
  3. blaklaybul thread starter macrumors regular

    blaklaybul

    Joined:
    Aug 29, 2007
    Location:
    New York City
    #3
    ughhh....its gotta be in html

    if you check out my site

    www.i5.nyu.edu/~mah533

    and navigate to galleries > michael hirsch

    and then click on a picture...theres no way with html to make that white space black?

    thanks
     
  4. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
  5. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #6
    That one works. As a said before, it's a browser setting. I changed Firefox's background color and that white went black. That area is showing just an image, not an HTML page, which can have its colors modified.

    The page would need to be redesigned so it's not using those frames. JavaScript would be a decent choice here. You could also try using an iframe, which has a little more control, but I don't really recommend that.

    Edit:
    Here's a JavaScript powered gallery that has a similar look and feel to your current page.

    Edit2:
    Actually, there just may be a way. From this page, there's a discussion covering ways to do it in Firefox and IE, though I've never tested these. On your frame tag for the image add the following two attributes.
    Code:
    style="background:#000;" allowtransparency="true"
    The second attribute isn't standard though, so it won't validate, and I'm not sure how other browsers will handle these.
     

Share This Page