QUICK NEWS

{NEW} - A new css video is up.

{OLD} - New video courtesy of Skhilled, Thanks for posting it up.

Video of the moment:


Internal Links

SMF Sites

Quick Info

Background Image

Started by LandyVlad, Feb 06, 2019, 10:09 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

LandyVlad

I have probably asked this before, elsewhere, but...

How do I put a background image on my forum, just as you've done here ?
Please do not PM me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Bigguy

Give me a sec and I will post the css for it.
"It's the American dream....cause ya have to be asleep to believe it." - George Carlin

Bigguy

#2
Right at the top of the index.css file this is what I have:

html {
background:  #0C3E61;
}
body {
background:url(https://www.yoursite.com/image.jpg) #0C3E61;
    background-attachment: fixed;
    background-size: 100% 100%;
font: 83.33%/150% "Segoe UI", "Helvetica Neue", "Nimbus Sans L", Arial, "Liberation Sans", sans-serif;
color: #4d4d4d;
display: flex;
flex-direction: column;
min-height: 100vh;
}

I fixed the background image, gave it a different color to match the image and added the url. :) This should be what you want.
"It's the American dream....cause ya have to be asleep to believe it." - George Carlin

LandyVlad

Thanks muchly.

In the line
background:url(https://www.yoursite.com/image.jpg) #0C3E61

What's that hash value do?

Oh and
Quote from: Bigguy on Feb 06, 2019, 11:22 PMI fixed the background image, gave it a different color to match the image and added the url.

Looking at this forum (SMFH) The URL is black on a very dark background so I can't see it.

as for giving the background a different colour to match the image - I presume you mean the main logo - but I haven't noticed any background colour change.
Please do not PM me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Bigguy

Sometimes when the page loads the background image sort of stalls for a minute and loads in last. Before it loads in the background goes white, which is the default color. I changed the color to blue. So now when the page loads and the image is slow you see a blue background instead of plain old white.
"It's the American dream....cause ya have to be asleep to believe it." - George Carlin

LandyVlad

Please do not PM me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Bigguy

Yes and you will. If you clear your browser cache you might be able to see a flash of blue before the background image loads up when you refresh the page.
"It's the American dream....cause ya have to be asleep to believe it." - George Carlin

LandyVlad

so the image in that code example goes in the public html directory, yes?
Please do not PM me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Bigguy

Yes but you can put the image anywhere you want, as long as the url points to it. A lot of people put all images in the Themes/default/images directory to keep things clean.
"It's the American dream....cause ya have to be asleep to believe it." - George Carlin

lesmond

Quote from: LandyVlad on Feb 08, 2019, 01:11 AMWhat's that hash value do?

Thats for the colour ie. #000000 would be black and #ffffff is white

The only person who got all his work done by Friday was Robinson Crusoe

LandyVlad

Cheers les yeah I knew that but was really getting at what it does in that particular place, which bg answered :)
Please do not PM me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.