Ask A Question

Notifications

You’re not receiving notifications from this thread.

CSS Beginner Need Help

AfjalKhan asked in CSS

Hi, i am new to CSS and HTML and i have been trying to make the background of my HTML site an image, but it doesnt seem to work and the image does not appear on my HTML after i have refreshed the page.

Here is the code that i am using :

background-image: url('.../images/bgimage.jpg')

The problem is either i am doing something wrong with my code or my image is not in the right place and the code cannot find the image.

Reply

You also have a triple ... which may be a typo and you meant ..

In the asset pipeline, you have to reference files using the asset helpers so they can be found in production. You would do image-url('bgimage.jpg')

https://guides.rubyonrails.org/asset_pipeline.html#css-and-sass

Reply

Hi, i am new to CSS and HTML and i have been trying to make the background of my HTML site an image, but it doesnt seem to work and the image does not appear https://trackeasy.fun/usps/ on my HTML after i have refreshed the page.

Here is the code that i am using :

background-image: url('.../images/bgimage.jpg')

The problem is either i am doing something wrong with my code or my image is not in the right place and the code cannot find the image.

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 85,831+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.