Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

CSS3 backgroubd

Featured Replies

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 by Backes

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 by A­­

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.