+ 17

how to get image from my device using img tag?

3rd Nov 2018, 3:40 PM
Ayan Fox
Ayan Fox - avatar
6 Antworten
+ 9
The above 2 cases are tedious and unorganised when you are having multiple images ,thus its preferred to go with the 3rd case below 3 ) Organise all the images to a certain folder Create a new folder (say images ) under the folder which contains .html fileCopy all the images to images folderHere no need of lengthy locations just the floder name ( here : images ) a forward slash follwed by image name nd extensionFor example <img src= “images /nissan_gtr.jpg />……………….In case if u want to publish a image which is alredy in some server just use the url address of it as the value of src attributeThere are also attributes for img tag for like resizing it and all which can be done through css though Thank you,hope u got what u wanted to know Happy Coding 😇😇😇🙌🙌🙌🙌🙌
3rd Nov 2018, 4:44 PM
Asmit joy
Asmit joy - avatar
+ 11
The tag to be used is : <img> You might have seen many html tags which has a opening tag and a closing tag , image tag doesn't fall into tha category its a Self-closing tag. Syntax : <img attributes /> Mandatory attribute to be used is src this attribute specifies the location of the image to the browser. The value for this attribute changes according to the following scenarios 1 ) If the image is in the same folder as the .html file Copy the image u wanna display on the webpage to the same folder where your .html file is located.Add the value to the src attribute as your image name with its extensionFor example : <img src = “ nissan_gtr.jpg” /> 2 ) If the image is in a different folder Right click on the image and go to propertiesCopy the location of the imageChange the back slashes `\` to forward slashes ‘/’Use them in src value followed by a forward slash ,image name and extensionFor example : <img src= “ c:/users/xyz/pictures/cars/nissan_gtr.jpg />
3rd Nov 2018, 4:43 PM
Asmit joy
Asmit joy - avatar
+ 6
thanks to everyone for helping me.....😃😃
9th Nov 2018, 1:51 PM
Ayan Fox
Ayan Fox - avatar
+ 5
Use <Img src="imalocation/name.jpg" alt="">
4th Nov 2018, 8:50 PM
Precious Obaseki
Precious Obaseki - avatar
+ 5
When it comes to code not working, it's good to be clear where you are running your code from (e.g. the SoloLearn Code Playground or locally on your laptop / desktop computer, etc.) and where your assets are located (e.g. publicly hosted or privately on your laptop / desktop computer, etc.). Otherwise, it's difficult to know where the disconnect may be occurring. For what it's worth: https://code.sololearn.com/W1HE74c6JmEX/?ref=app
4th Nov 2018, 9:02 PM
Janning⭐
Janning⭐ - avatar
+ 2
Here is the example. Please use phone device. https://code.sololearn.com/WcSALgsaZKBv/?ref=app in case of desktop you should use another approach
4th Nov 2018, 9:43 PM
Sergei No
Sergei No - avatar