/    Sign up×
Community /Pin to ProfileBookmark

Centering Divs

Ok, I am very new to css and I read a tutorial on how to make a drop shadow effect on images. The method involves creating 3 divs, with the image file in the innermost, and then 3 shadow image files within each of the 3 divs as well. I tried to create a fourth outermost div with the property margin: 0 auto; so that it would center the whole thing. To see what I mean:

[URL=http://d3kicks.com/css/forum.html]http://d3kicks.com/css/forum.html[/URL]

For some reason it wont center the whole thing… Here is the code:

<html>
<style>
.wrap0 {
margin: 0 auto;
}

.wrap1 {
float: left;
background:url(shadow.gif) right bottom no-repeat;

}

.wrap2 {background:url(corner_bl.gif) left bottom no-repeat;}
.wrap3 {
padding:0 8px 8px 0;
background:url(corner_tr.gif) right top no-repeat;}
</style>
<body>
<div class= “wrap0″><div class=”wrap1″><div class=”wrap2″><div class=”wrap3″><img src=”logo.jpg” width=”209″ height=”204″ /></div></div></div></div>
</body>
</html>

Can anyone tell me what I am doing wrong, and why the image is not centering on the page…

to post a comment
CSS

1 Comments(s)

Copy linkTweet thisAlerts:
@FangJun 19.2006 — .wrap0 must have a width defined.
×

Success!

Help @mateobus 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 4.29,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

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