/    Sign up×
Community /Pin to ProfileBookmark

Layout problem…

Hi there everyone.

Im new to webdesign so please go easy on me ?
A friend built a webpage for me a while ago and now I decided to TRY and redesign it. Take a look at what I’ve got already: [url]http://www.verchiesoft.com/[/url]

What I’d like to do is center what I’ve done so far in the middle of the browser no matter what screen resolution users are viewing in. Can anyone please help me out? Thanks in advance. ?

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@FangMay 05.2006 — The basics:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>Basic center page with elements position:absolute</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
html, body {
margin:0;
text-align:center;
}
#container {
position:relative; /* parent of absolute positioned contents */
margin:0 auto;
width:80%; /* change to required width */
text-align:left;
}
#contents { /* any element here is centered */
border:1px solid red;
}
</style>
</head>
<body>
<div id="container">
<div id="contents">
<p>contents</p>
</div>
</div>
</body>
</html>

It does mean you will have to change the [I]left[/I] values of all absolutely positioned elements and some background image have to be placed outside of [I]#container[/I].

Design and implement, not implement and re-design.

In the majority on cases absolutely positioned elements can be replaced by static (default) elements in a correctly implemented css layout.
Copy linkTweet thisAlerts:
@SlinkirothauthorMay 05.2006 — It worked like a charm! Thanks a lot! ?
×

Success!

Help @Slinkiroth 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 6.2,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

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

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...