All threads / CSS Beginner Need Help
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.

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

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.

Join the discussion

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

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

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

    logo Created with Sketch.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

    © 2022 GoRails, LLC. All rights reserved.