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>
    WARNING: Use code provided at your own risk!

  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.
    Windows XP SP2 - theme: Thallos
    AMD Athlon 64 X2 4600+ | ASUS M2N32-SLI Deluxe | 2 * 1024 PC2-6400 Mushkin DDR2-800 | eVGA GeForce 6800XT 256MB | Creative Sound Blaster X-FI Music
    5 * 320GB Seagate Barracuda SATA-II 3Gb/s in RAID 5 | Lite-On 16x DVD-RW | Mitsumi 7-in-1 Floppy drive and card reader
    Samsung SyncMaster 204B 20" TFT LCD | Logitech G15 Keyboard | Logitech G7 Mouse | Seasonic PC160SK Headset

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