Background Image - Post ID 2158

User 371836 Photo


Registered User
20 posts

Hey.

Does anyone know how to add an image as background.
Adding it self is no trouble.
But if i only want my image to be shown one time insted of servel times. That i can't make it.

I'm trying to place my company logo as a watermark.

Look at www.stegmann-support.com

you will see my problem right away.
My logo is all over the screen. I only want it placed 1 time.

Any idear????

Regards Bjarne
User 355448 Photo


Ambassador
3,144 posts

Bjarne,

Maybe what you want is something like this:

background-image: url('background.jpg');
background-repeat: no-repeat;
background-attachment: fixed;
background-position: center center;

That four lines of CSS style will put background.jpg on your page, will not repeat it, will fix it in a spot on the browser, and will center it vertically and horizontally.

Is that what you wanted?
User 371836 Photo


Registered User
20 posts

Perfect.

Thanks Billr.

That was exactly what i was looking for.

Thanks
Bjarne
User 371836 Photo


Registered User
20 posts

Hi again Billr.

One more quicky.
Know when we are talking about pictures.

Is there a quick way to put a picture on the page and then center it vertically and horizontally.

Just like your exemple with the background image??

Regards
Bjarne
User 355448 Photo


Ambassador
3,144 posts

Bjarne,

Is the page going to have nothing except a photo?

You might try something with CSS.

I would need to play around with the margin settings to get something that would keep a photo centered on any size page. It might be easier to set a specific width and height for a page and center to that.
User 371836 Photo


Registered User
20 posts

Hi Billr.

Yes, my idear was that on the main frame, when people comes to my webpage. There should only be one picture and thats it.
Then they should use the navigation to see what they want.

So one picture on the firstpage / Homepage / welcome page what ever.

And that picture should be center H / V no matter with resolution or monitor they are using.

Regards
Bjarne
User 355448 Photo


Ambassador
3,144 posts

Bjarne,

Do you have a page that you are working on?

What sort of navigation are you going to use? Will there be navigation to take you to another page, navigation to change the photo, or both?

It sounds a little like a job for the CoffeeCup Photo Gallery.
User 371836 Photo


Registered User
20 posts

Hi Billr.

Yes i have onloaded the page to my web.
Right now the picture is center på at the top of the page.
That picture i would like to be center in the middle of the page.

Take at look
www.stegmann-support.com

Regards
Bjarne
User 355448 Photo


Ambassador
3,144 posts

Bjarne,

I have looked at main.html and will play around with the code to see if I can center vertical.
User 355448 Photo


Ambassador
3,144 posts

Bjarne,

Take a look at this.

The only thing I could get to work was make the image a background.

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.