/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Aligning images

I’m obviously still trying to figure out CSS. I’m following [URL=”http://css.maxdesign.com.au/floatutorial/tutorial0915.htm”]this [/URL]example and trying to make a liquid css layout. My problem is that in the footer div I’d like to align 4 images as shown in the attachment. If I just place them all in the div it looks good except for image C. I’m confused about the clear:both that’s applied to the footer div and how that might affect these images. What’s the “best practice” way to approach this? Thanks.

[upl-file uuid=ea4d12e0-8b42-401d-b9a7-faccbc350081 size=1kB]footer.gif[/upl-file]

to post a comment
CSS

1 Comments(s)

Copy linkTweet thisAlerts:
@aj_nscNov 17.2008 — To try and replicate what you're talking about, I put the clear: both on the footer div and it really shouldn't make a difference. Have a look at something like this, you'd just replace the divs with the images

[code=html]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Sample Page</title>
<meta http-equiv="Content-type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Language" content="en-us" />
</head>
<body>

<div id="footer" style="clear: both; border: 1px solid #000; height: 200px; padding: 0 20px;">
<div style="border: 1px solid #000; text-align: center; margin: 5px auto;">
this is image one
</div>
<div style="float: right; width: 150px; height: 150px; border: 1px solid #000;">box c</div>
<div style="float: left; width: 150px; height: 150px; border: 1px solid #000;">box a</div>
<div style="float: left; width: 150px; height: 150px; border: 1px solid #000; margin-left: 20px;">box b</div>
</div>
</body>
</html>

[/code]
×

Success!

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