/    Sign up×
Community /Pin to ProfileBookmark

How to set the page when it is expanded?

I am currently just messing around in my notepad and trying different things out. I was creating the page without the whole page expanded and when I did expand it all of the things on the page stayed to the left. So my question is what do I need to do to have everything centered again when someone expands the page? Any help is greatly appreciated. Thank you

to post a comment
CSS

4 Comments(s)

Copy linkTweet thisAlerts:
@smyhreJan 17.2008 — Well some code would really be nice to see, but generally the way I center things in that situation is have a division around all the content you want centered and have the {margin: 0 auto 0 auto} that should center it.

Similar to below:
[code=php]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>

<style type="text/css">
#wrapper {margin: 0 auto 0 auto; width: 600px;}
</style>
</head>

<body>

<div id="wrapper">
<p>content to be centered</p>
</div>

</body>
</html>
[/code]
Copy linkTweet thisAlerts:
@dtm32236Jan 17.2008 — not that it matters, but....

[B]margin {0 auto;}[/B] works just the same.... it applies 0 to top and bottom, and auto to left and right.

and if you want a fluid layout, make the width a percentage (try width:85%)
Copy linkTweet thisAlerts:
@smyhreJan 18.2008 — Very true dtm. Forgot to mention the shortcut.
Copy linkTweet thisAlerts:
@mc2thetauthorJan 18.2008 — Okay I will try that. Thank you very much
×

Success!

Help @mc2thet spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...