/    Sign up×
Community /Pin to ProfileBookmark

how to center object?

helou!

first, here’s the link of my homepage: [url]http://two.xthost.info/mojcalj/index.html[/url]
the problem is that i don’t know how to center it verticaly also!
i’ve tried with table….but then it’ works only for vetricaly, i don’t know what’s the problem, so please if anyone know…. thank you!

to post a comment
HTML

2 Comments(s)

Copy linkTweet thisAlerts:
@abzOct 15.2006 — You have a few html errors there: http://validator.w3.org/check?uri=http%3A%2F%2Ftwo.xthost.info%2Fmojcalj%2Findex.html

I dont know what version of HTML you are using, but personally, I would put all the content you want centred into a <div id="content"></div>

then add a bit of CSS into your <head></head> tags:

[CODE]
<style type="text/css">
<!--
#content{
margin-top: 5%;
}
-->
</style>
[/CODE]
Copy linkTweet thisAlerts:
@_Aerospace_Eng_Oct 16.2006 — &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
&lt;title&gt;Index&lt;/title&gt;
&lt;style type="text/css"&gt;
html, body {
margin:0;
padding:0;
background:#FFF url(029.gif) center;
height:100%;
border:0;
overflow:auto;
}
#container {
width:588px;
height:435px;
position:absolute;
left:50%;
top:50%;
margin-left:-294px;
margin-top:-217px;
}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id="container"&gt;
&lt;object type="application/x-shockwave-flash" data="index.swf" width="588" height="435"&gt;
&lt;param name="movie" value="index.swf"&gt;
&lt;/object&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
×

Success!

Help @moka 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.17,
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,
)...