Background Image Won't Display on GitHub Pages #35195
-
Hi all, I've published my portfolio using GitHub Pages, and all the code seems to work except that my background image won't display. That image (portBackground.jpg) is the lynchpin of my portfolio, because it sets the stage, mood, and story of the site's design. Following similar discussions I discovered on the internet, I've changed the image from a .png to a .jpg, moved it into an exclusive "images" folder, and I even cleared my browser's cache from the previous hour before I uploaded it. So it's bothering me to no end as to why the image won't display. Would you please help me out? My GitHub Pages published site link: https://nathan-friedman-designs.github.io/nathanfriedmanportfolio/ My repository: https://github.com/nathan-friedman-designs/nathanfriedmanportfolio Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments 6 replies
-
You need to change the image url from
|
Beta Was this translation helpful? Give feedback.
-
seems it's already fixed by now ? |
Beta Was this translation helpful? Give feedback.
-
cheers for posting this it took me ages to work that out |
Beta Was this translation helpful? Give feedback.
-
Also had this problem but my solution was removing the quote from the path. e.g |
Beta Was this translation helpful? Give feedback.
-
Remove the .. from the file paths as that directs them somewhere else so if a file path is ../assets/images/image.jpg then remove the “..” so it would be /assets/images/image.jpgOn 31 Aug 2023, at 17:37, Şahin Əliyarlı ***@***.***> wrote:
same problem here, did you find any solution?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Sorry I spoke too soon, reading back over my CSS file from my last submission I removed the “quotes” inside URL so it would be- url(../images/pattern-background-desktop.svg)After doing this it fixed the problem of my images not displaying when page deployed. Hope this helps!Sent from my iPhoneOn 31 Aug 2023, at 18:49, Şahin Əliyarlı ***@***.***> wrote:
But then, locally, it won't be working anymore. How do you adapt with this?
Remove the .. from the file paths as that directs them somewhere else so if a file path is ../assets/images/image.jpg then remove the “..” so it would be /assets/images/image.jpgOn 31 Aug 2023, at 17:37, Şahin Əliyarlı @.> wrote: same problem here, did you find any solution? —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.>
i tried these solutions but none of them worked:
background-image: url("");
background-image: url("./images/pattern-background-desktop.svg");
background-image: url("/images/pattern-background-desktop.svg");
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hi guys am faced with the same problem my background image wont display in the download file. What am I missing? Please help! My css code is below. |
Beta Was this translation helpful? Give feedback.
-
I tested all the ways and they all worked, but you need a few minutes for them to work on the Git-Hub pages. |
Beta Was this translation helpful? Give feedback.
-
Hi, I have the same issue but none of the possible solutions worked for me. The images are where they are supposed to be but I keep getting a 404. I deployed the web to netflify and it works there. Github pages> https://rse-r.github.io/intro-programacion/ The issue is with the icons inside each box. |
Beta Was this translation helpful? Give feedback.
You need to change the image url from
url("images\portBackground.jpg");
to"../images/portBackground.jpg"
../
), sinceimages/
dir is outside of thecss
dirhttps://github.com/nathan-friedman-designs/nathanfriedmanportfolio/blob/420f4f5ea4aeccc41ba89e4212eb818f77136e34/css/index.css#L6