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.

Centered site like webdesignerforum

Featured Replies

im trying to develop a web site with the same functionality as webdesignerforum.co.uk and www.newyorkjets.com

 

as you notice that if you resize the resolution to 1024x768 the content fits lovely slap bang in the middle. now if you increase the resolution to whatever the page and background elemnets stay in the middle. this looks like it has been done using pixels rather than %

 

How can i do this with my background image attached. been racking my brains over this and cant get my head around it, but im sure its simple.

post-33740-0-81724200-1331049678_thumb.png

  • Author

so i have this in my css

 

body{
background-image: url('images/background.png');
}

#wrapper { 
 width: 978px; /*or whatever */ 
 height: 200px;
 margin: 0 auto;
 border: solid 1px black;
}

 

 

and i have this in my .php

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title></title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>

<body>

<div id="wrapper"></div>

</body>

</html>

 

It renders fine in my larger resolution of 1600 x 900 but when i view in smaller resolution the wrapper is shifting and overlapping onto the left side of my packground as you can see in attachment. why is this?

post-33740-0-91577000-1331053591_thumb.jpg

Edited by Renaissance-Design
Please use the code button or tags to format your code.

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.