submit button with images in xhtml

Discussion in 'HTML & Website Design' started by vicky1408, Dec 15, 2008.

  1. #1
    hi there,

    I am having a real silly doubt here..

    For the submit button in input tag to add images,we can use image source in the input tag itself like this below,

    "<input type="image" src="submit.gif" alt="submit form" />"

    But for some templates which I had seen,instead of using input tag,they used "div" tag in html and "background-image" in css for the submit button like this,

    div.submit_button
    {
    background-image : submit.gif;
    width : 30px;
    height : 20px;
    border-width : 0px;
    }

    I know the former is correct,but I am having a silly doubt here..I just need to confirm it.

    which is the correct one,according to the standards? :)
     
    vicky1408, Dec 15, 2008 IP
  2. PixelRaider

    PixelRaider Banned

    Messages:
    57
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Both are W3C (xHTML 1.0) Complaint if that's what you mean by 'standards'. Personally i'd say it's much easier to use input type="image". If you use the latter option you then need to start messing around with the border attribute etc etc to make it look right.
     
    PixelRaider, Dec 16, 2008 IP