×

Discussion Board

Results 1 to 4 of 4

Hybrid View

  1. #1
    Regular Contributor
    Join Date
    Mar 2005
    Location
    Hamburg, Germany
    Posts
    283

    Image or div with backgroud-image, what is difference

    Hello developers,

    There are two ways to display an image:
    1) classic image tag
    2) a div element (or another relement) and set a background image

    I noticed that in the location example the div-background element is used.
    see http://www.developer.nokia.com/Commu...cation_example

    What are the differences between the two ways in the context of S40-Webapps, are there any advantages when you use div-background-images?

    Regards

    Karsten Meier

  2. #2
    Regular Contributor
    Join Date
    Jun 2010
    Posts
    161

    Re: Image or div with backgroud-image, what is difference

    One big advantage in using a div is that you can overlay UI elements like buttons, since you can put stuff in the div.

  3. #3
    Registered User
    Join Date
    Mar 2013
    Location
    United Kingdom
    Posts
    161

    Re: Image or div with backgroud-image, what is difference

    I will always personally wrap an img tag in a div (just for readability). In reality though, I'd say it makes no difference.

  4. #4
    Regular Contributor
    Join Date
    Mar 2005
    Location
    Hamburg, Germany
    Posts
    283

    Re: Image or div with backgroud-image, what is difference

    I just noticed a warning in the IDE that "attribut 'class' for element 'image' is not supported for browser runtime 2.0".
    So if we want to do something with the css-class of an image, we sometimes need to use the div-background-image trick.

Similar Threads

  1. Marker with icon and image backgroud
    By AlterX in forum [Archived] Maps API for Javascript
    Replies: 7
    Last Post: 2012-08-15, 13:11
  2. Difference between drawing an Image and painting a Sprite
    By valdomero in forum Mobile Java General
    Replies: 2
    Last Post: 2009-12-04, 18:35
  3. Replies: 0
    Last Post: 2009-07-31, 10:18
  4. set an image as a backgroud?
    By dakoz in forum Symbian User Interface
    Replies: 1
    Last Post: 2006-04-21, 18:21
  5. difference in image size
    By gaurav17281 in forum Symbian
    Replies: 1
    Last Post: 2003-08-07, 03:45

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×