setting image background property to...

User 228273 Photo


Registered User
32 posts

Once you have exported the files and opened up main.css , how do you set a background image property to a row. I have tried to using this code but it does not work.

html:
<body>
<div class="row some-class">
<div class="coffee-span-12"></div>
</div>
<div class="row">
<div class="coffee-span-6"></div>
<div class="coffee-span-4"></div>
<div class="coffee-span-2"></div>
</div>
</body>

css:

body > .row.some-class {
background-image:url('some_image.jpg');
}

Any help would be appreciated, thank you.


User 187934 Photo


Senior Advisor
20,181 posts

I would try absolute to make sure you have the path correct.
body > .row.some-class {
background-image:url('http://mydomain.com/images/some_image.jpg');
}
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 228273 Photo


Registered User
32 posts

Hi Eric, I have tested the path of the image, and it is typed correctly.
This is the html code with the image test which displays the image in the column just fine , yet the background image for the row does not show at all.

html:
<div class="row image-here">
<div class="coffee-span-12"></div>
</div>
<div class="row">
<div class="coffee-span-6"></div>
<div class="coffee-span-4"><img class="image-4-3" src="img/1.jpg" alt="Image">
</div>
<div class="coffee-span-2"></div>
</div>

css:
body > .row.some-class {
background-image:url('img/1.jpg');
}

Any further help is appreciated, thank you.
User 228273 Photo


Registered User
32 posts

Eric, just noticed error body > .row.some-class { changed it to body > .row.image-here {

but does not work anyway. This code is not on a server by the way.
User 187934 Photo


Senior Advisor
20,181 posts

Where is your background image located?
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 228273 Photo


Registered User
32 posts

Eric,
image is located in the same directory as the image that shows up just fine in this part of the code

<div class="coffee-span-4"><img class="image-4-3" src="img/1.jpg" alt="Image">

in the directory named "img" which resides in the directory that holds the other directories css,fonts,js

thanks for any help, appreciated as always.
User 187934 Photo


Senior Advisor
20,181 posts

If you would publish the site it sure would make it easier to help as JoAnn stated already.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 187934 Photo


Senior Advisor
20,181 posts

Try this.
Adjust the .coffee-span-16 to your actual class.
.coffee-span-16{
background-image:url('img/1.jpg');
}

I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 228273 Photo


Registered User
32 posts

Eric, I will try what you have just suggested, here are files on server http://stream8media.com/test/coffeecup/
User 228273 Photo


Registered User
32 posts

Eric..no joy with the suggested:

.coffee-span-16{
background-image:url('img/1.jpg');
}

i assumed you meant....coffee-span-12

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.