August 30, 201313 yr Hey, I found this CSS code on a webpage background:url(img/body_bg.jpg) no-repeat scroll center 35px rgb(247, 252, 255); When I now want to write this in CSS2, I have this: background-image:url(img/body_bg.jpg); background-repeat:no-repeat; background-attachment:scroll; background-position:center; background-color:#FFF; But I can't figure out, what the "35px" means in the CSS3 code. Without this value, the background image starts in the middle of the image. //edit: The "35px" are used like this: background-position:center 35px; Edited August 30, 201313 yr by Backes
August 30, 201313 yr It sounds like you're confusing the shorthand CSS for CSS3? You're just writing it out a longer way, the line you found is also CSS2. The 35px is part of the background-position, background:url(img/body_bg.jpg) no-repeat scroll [center 35px] rgb(247, 252, 255); background-position expects an x and a y value. As you've just given it 'center', it's the same as background-position: center center; hence the center of the image is at the top. You want: background-position:center 35px; Edited August 30, 201313 yr by A
Create an account or sign in to comment