Set style background in html and not...

User 2098239 Photo


Registered User
17 posts

Hello all. It's a little late here so I may have missed if someone has asked this elsewhere.

I have loaded a template and I have some background images, the location of the images are set in the CSS file.

If I change the photo then the CSS changes to reflect this.

How can I remove the image location from the CSS and add it to my html as a style?

Many thanks.
Carl
User 122279 Photo


Senior Advisor
14,447 posts
Online Now

Background images are always referenced in the CSS file. If you want to have background images, they will have to be referenced like that.

If you want them to be 'foreground' images, you can use HTML to add them, but the styling is still done with CSS.

Using 'HTML style tags' would be like going some 25 years back in time. Site Designer is not made for that. But if you insist, you can do it the old-fashioned way with the HTML Editor.
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com


User 2098239 Photo


Registered User
17 posts

Thankyou.
The reason I asked about this is I am learning laravel and following a tutorial on how to make a dynamic front end from a static html page.

This involves creating a database to populate areas of the static layout by using the static layout with the blade template engine.

So, for most things it's all great, but when the images are inside the CSS file then they can't be replaced using the blade syntax.

There's obviously a way to programmatically rewrite the CSS on an image change on the database side, I will look at that.

Many thanks
Carl

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.