/    Sign up×
Community /Pin to ProfileBookmark

Centering in a div

The flash file in the <content> div area of iprezence.com/paintshop/indexTest.htm is being offset from the left margin and the right end extends off the conrent area. The flash file should fit the page width. Can someone point out what I need to do to fix this?

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@George88Sep 25.2012 — You can use a simple trick to centre a <div> like so:

<i>
</i>#your_div
{
margin-right: auto;
margin-left: auto;
}


That will give automatic margins to both sides, centring the element. You might also be able to use the text-align property in CSS to align the contents to the centre:

<i>
</i>#your_div
{
text-align: center;
}
Copy linkTweet thisAlerts:
@DocRockauthorSep 25.2012 — Thanks, that worked. But now the menu buttons are offset from the left margin and are truncated on the right. I can't seem to find the source of the css that is causing it. Any help is appreciated.
×

Success!

Help @DocRock 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.18,
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,
)...