/    Sign up×
Community /Pin to ProfileBookmark

Hi!

I understand that when using CSS <div align=”center”> won’t cut it, so whats the best way to center something?

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@pcthugFeb 06.2006 — [CODE]
/* OR TRY */
body {text-align:center;}
#container {width:750px; text-align:left; margin:0 auto;}
[/CODE]
Copy linkTweet thisAlerts:
@WebJoelFeb 06.2006 — You could also create a DIV and position it absolute at 50%, and relative position it at minus half of it's width. -A round-a-bout way to do it, but it centers it also. I sort of prefer the method stated above though.
×

Success!

Help @comptech520 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.19,
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,
)...