Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. image in division

image in division

Scheduled Pinned Locked Moved Web Development
helptutorial
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 11886269
    wrote on last edited by
    #1

    how to display image on division i have code as follows

    but no image is getting displayed on division...wts going wrong please help me out of it.

    Richard DeemingR 1 Reply Last reply
    0
    • U User 11886269

      how to display image on division i have code as follows

      but no image is getting displayed on division...wts going wrong please help me out of it.

      Richard DeemingR Offline
      Richard DeemingR Offline
      Richard Deeming
      wrote on last edited by
      #2

      Member 11919722 wrote:

      background-image:url('C:\Users\admin\Desktop\imag\cutis.jpg');

      You've specified a local path for the image. That will only work if you load the HTML file from a local path. When you load the file from a website, the browser will not allow you to try to load images from the client's local system. You need to put the image in a folder on your site, and use a proper URL to reference it:

      background-image:url('path/to/your/image.jpg');

      You can either use a full URL: https://www.yoursite.com/path/to/your/image.jpg Or an absolute path on your site: /path/to/your/image.jpg Or a path relative to the file where the CSS style is declared: ../../path/to/your/image.jpg


      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

      U 2 Replies Last reply
      0
      • Richard DeemingR Richard Deeming

        Member 11919722 wrote:

        background-image:url('C:\Users\admin\Desktop\imag\cutis.jpg');

        You've specified a local path for the image. That will only work if you load the HTML file from a local path. When you load the file from a website, the browser will not allow you to try to load images from the client's local system. You need to put the image in a folder on your site, and use a proper URL to reference it:

        background-image:url('path/to/your/image.jpg');

        You can either use a full URL: https://www.yoursite.com/path/to/your/image.jpg Or an absolute path on your site: /path/to/your/image.jpg Or a path relative to the file where the CSS style is declared: ../../path/to/your/image.jpg


        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

        U Offline
        U Offline
        User 11886269
        wrote on last edited by
        #3

        thanks for the response but even after inserting an image to my asp.net application m not able to see image on division i did following changes in my code is that correct if not then plz tell where m doing wrong.

        Thanks

        1 Reply Last reply
        0
        • Richard DeemingR Richard Deeming

          Member 11919722 wrote:

          background-image:url('C:\Users\admin\Desktop\imag\cutis.jpg');

          You've specified a local path for the image. That will only work if you load the HTML file from a local path. When you load the file from a website, the browser will not allow you to try to load images from the client's local system. You need to put the image in a folder on your site, and use a proper URL to reference it:

          background-image:url('path/to/your/image.jpg');

          You can either use a full URL: https://www.yoursite.com/path/to/your/image.jpg Or an absolute path on your site: /path/to/your/image.jpg Or a path relative to the file where the CSS style is declared: ../../path/to/your/image.jpg


          "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

          U Offline
          U Offline
          User 11886269
          wrote on last edited by
          #4

          i got image to be displayed but i want only one image to be displayed in division but its dislaying same image on divison multiple times?

          Richard DeemingR 1 Reply Last reply
          0
          • U User 11886269

            i got image to be displayed but i want only one image to be displayed in division but its dislaying same image on divison multiple times?

            Richard DeemingR Offline
            Richard DeemingR Offline
            Richard Deeming
            wrote on last edited by
            #5

            Sounds like you need to add background-repeat: no-repeat; to the styles. CSS background-repeat Property | W3Schools[^]


            "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

            "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups