last day (15 days later) » 

5:59 AM
0
Q: upload photo for a html project

jasmineI want to code a simple website just with HTML and CSS . I did it with notepad on my PC. When I added a background photo to my #header" element, it isn't working. I've tried to replace the name and used from online editors. I can't find my error. I have a folder with style.css and index.html and ...

 
<title> on line 5 is misspelled.
 
@barhatsor oh thank you i fixed it but the photo didn't upload again . can you tell me about tne name of the photo ? i mean i should write the name or address od it ?
 
Add width:100vw to #header.
 
look it - background-sixe: cover; line of 4 in #header
 
@s.kuznetsov i fixed them but can you tell me is thre any wrong with this code or not?? url(images/Al-Hakawati.jpg); should i just add the name of my photo here ? or the address of it in my pc ?
 
5:59 AM
@jasmine instead of 100vw you should probably use 100vh since you most likely want to set the height to 100 percent of the viewport _height_ not width, which is what you have currently
 
@disinfor thanks i fixed it . can you tell me about this ? url(images/Al-Hakawati.jpg); should i just add the name of my photo here ? or the address of it in my pc
 
there are no problems with your code, except for the errors that we pointed out to you in here in the comments. Perhaps you indicated the wrong path to the picture. Open the browser object inspector and see if your image is loading or not ?!
 
You can test your code by using an external image. If that works, then it's the path to your image that is wrong. Try using this via.placeholder.com/800x600 instead of your image. If that works, then you know it's your image path.
 
@s.kuznetsov i opened it and it doesnt load . the name of photo is Al-Hakawati with jpg format and in the images folder > i don't know what to do . i even try the others photo !
 
From your code, you must have the html in a file. Inside the folder that holds that file is another, "images". Inside it, is your image. If you're not aware of "Relative Paths", you need to be, since you 've used one. It's a trivial concept, you'll be across it in no time.
 
5:59 AM
show how your css, html and image file are located.
 
@s.kuznetsov i got it ! my code has problem . i downloaded the images that who teaches the tutorial used . but didn't work again .youtu.be/zmun7JzWGPE
i swear the files located correct . i checked them . and did the same thing in the video
 
pls, take a screenshot of how your files are located - html, css and images folder
 
Failed to load resource: net::ERR_FILE_NOT_FOUND style.css:1
@s.kuznetsov I DO IT NOW JUST A SECOND .
@s.kuznetsov I did it ! uploaded here . PLEASE TAKE A LOOK . thank you
 
Are you trying to load the background image via url when in fact it is on your local machine or are you on a server?
 
@AHaworth yeah sir exactly . it is on local machine i downloaded them and save in a folder and i wanna linled this url to my css file
 
5:59 AM
but in your images folder I can't see an image named Al-Hakawati.jpg.
 
@s.kuznetsov yeah i changed that and codes too . i choose tha images that the video daid. but it didn't work too
 
I repeated your task on my PC. And it worked for me - ibb.co/DG1b5gJ. I know what your problem is. Now I will give a solution.
 
@s.kuznetsov thank you soooo much . so should i upload my images here from this link ? i downloaded the picture that you put that there
 
Did you manage to fix the problem?
 
@s.kuznetsov it worked !! thanksss so muchh
 

last day (15 days later) »