www.webdeveloper.com
Results 1 to 4 of 4

Thread: element for image

  1. #1
    Join Date
    Apr 2006
    Posts
    65

    element for image

    Hi,

    What the best element to use on an image?

    <p class="pictureperfect"> or <img class="pictureperfect" alt=""> or etc...

    .pictureperfect {
    position:absolute;
    background:url(../images/searcharrow.gif) no-repeat;
    width:53px;
    height:53px
    }

  2. #2
    Join Date
    Nov 2005
    Location
    The best country in the world, Texas!
    Posts
    251
    to get the effect i think you're looking for, you should use a block-level element such as a <DIV>

  3. #3
    Join Date
    May 2006
    Posts
    135
    as the person stated above a div is a nice choice

    but you can choose anything really...

    even inline-level elements.

    just add

    Code:
    display: block;
    to inline-level elements to have them behave like a block-level element.

    but a paragraph tag is a bad choice anyway.

  4. #4
    Join Date
    Nov 2003
    Location
    Canada
    Posts
    1,592
    Well actually, if that's a submit button (which it looks like it is), you should use an input submit image:
    Code:
    <input type="image" src="../images/searcharrow.gif" value="Submit" alt="Submit" />
    Also, if it's just a simple little image like that and not a background image (part of the layout), it's fine to just use an <img /> tag with an appropriate ALT attribute.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles