/    Sign up×
Community /Pin to ProfileBookmark

Center DIV (XHTML & CSS) – no tables

I want to make a website using XHTML and CSS.
I do not want to use tables for the lay-out but DIV-tags and CSS formatting.
I made a lay-out which looks okay on a 800 pixels wide screen.
When I go to a 1024 wide screen the lay-out still is okay but I have a lot of white space at the right side of the main frame.
I would like to center the frame (which is 770 pixels wide) so that on a 1024 screen my frame will have some white space on the left and on the right side but on a 800 screen my frame uses the whole screen.
An example of how this should be done is the side of Macromedia ([url]www.macromedia.com[/url]).
Can somebode help me with this please?
Thank you very much.

Best regards,

Peter

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@David_HarrisonJul 21.2004 — Without seeing any code, I'd recommend doing this:body{
text-align:center; /* IE styles. */
}

#outerdiv{
text-align:left;
margin:0 auto;
}
Copy linkTweet thisAlerts:
@peter_saevendonauthorJul 21.2004 — Thank you very much, GOD ? , it works.

Best wishes ?
Copy linkTweet thisAlerts:
@David_HarrisonJul 21.2004 — [i]Originally posted by peter_saevendon[/i]

[B]Thank you very much, GOD[/B][/QUOTE]
I've never been called that before. ?

Happy to help. ?
×

Success!

Help @peter_saevendon 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.27,
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,
)...