Page 1 of 1

CSS code to lock an image that will scroll with the screen

Posted: Sat 03 Jan 2015 4:31 am
by K8POS
I am not new to using HTML, but know little about CSS.
I have added my logo image to my web page. It shows up fine on each page at the top left of the screen.
Here is the code:

background-color: #00FFCC;
font-family: Verdana, Helvetica, sans-serif;
font-size: 10pt;
color: #585858;
text-align: left;
background-attachment: fixed; <----- I think I need to change this
background-image: url(images/MWlogo.png);
background-repeat: no-repeat;
background-position: TOP:35px; LEFT:170px;
I want the image to scroll up and down with the screen and not remain fixed. and it needs to move way over to the right.

Suggestions?

Bob

Re: CSS code to lock an image that will scroll with the scre

Posted: Sat 03 Jan 2015 11:01 am
by duke
Yes, to 'scroll'.
CSS Syntax
background-attachment: scroll|fixed|local|initial|inherit;
Property Values
Value Description
scroll The background scrolls along with the element. This is default
fixed The background is fixed with regard to the viewport
local The background scrolls along with the element's contents
initial Sets this property to its default value. Read about initial
inherit Inherits this property from its parent element. Read about inherit
More here.

Re: CSS code to lock an image that will scroll with the scre

Posted: Sat 03 Jan 2015 2:04 pm
by K8POS
Duke,

Thank you ever so much!!!!!! :clap:
Got it working where I want it.

Bob