/    Sign up×
Community /Pin to ProfileBookmark

centering a div within a div…

The relevant CSS:

#right{
margin-left:300px;
}
#left{
position: absolute;
left: 5px;
padding: 0px;
width: 300px;
text-align: center;
}
#links{
width: 150px;
}

The relevant HTML:

<div id=”right”>
<p>This is one way you can get in contact with me other than e-mail. Sign my guestbook, and I’ll get back to you!</p>
</div>

<div id=”left”>
<div id=”links”>
<div class=”framelink”>
<a href=”http://www.012guestbook.com/cgi-bin/guestbook.pl?a=38501″>Sign my guestbook</a>
<hr />
<a href=”http://www.012guestbook.com/cgi-bin/viewmessages.pl?a=38501″>View my guestbook</a>
</div>
</div>
</div>

I’m trying to center the links div inside the left div. What am I doing wrong?

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@BonRougeOct 24.2004 — #links{

margin: 0 auto;

width: 150px;

}
Copy linkTweet thisAlerts:
@Mr_Initial_ManauthorOct 24.2004 — Thanks, man!
×

Success!

Help @Mr_Initial_Man 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.16,
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,
)...