/    Sign up×
Community /Pin to ProfileBookmark

make center both vertical & horizonal

i’m wondering unknow on making element in html center to browser ‘screen. i wanna use javascript to solve this. thanks !?

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@KorSep 23.2010 — i'm wondering unknow on making element in html center to browser 'screen. i wanna use javascript to solve this. thanks !?[/QUOTE]
Horizontally

http://haslayout.net/css-tuts/Horizontal-Centering

Vertically

http://www.jakpsatweb.cz/css/css-vertical-center-solution.html

No JavaScript is needed, as far as I know. You may also google for other solutions.
Copy linkTweet thisAlerts:
@huyhoang08authorSep 23.2010 — thank for your help. i think that is good ideal for me, but my opinion that change position of element according relay on(or according to) size of browser' client/ size of document so that only client side language as javascript/jquery may be done. ?
Copy linkTweet thisAlerts:
@KorSep 23.2010 — CSS centering of an element has nothing to do with the browser's size or the document's size. It is always a [I]relative[/I] arrangement.
×

Success!

Help @huyhoang08 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.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: @nearjob,
tipped: article
amount: 1000 SATS,

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

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