/    Sign up×
Community /Pin to ProfileBookmark

I have a main containing element in the middle of my page. In this element I want to place three divs, (these three divs FORM A ROW that is centered relative to the containing element), and in each of them there is an image and a text link below it. I have no idea how to do this with CSS. This also has to work across browsers.

I thought I had a pretty good handle on CSS layout techniques until I came across this problem. It blew my mind. Any help or advice is much appreciated.

to post a comment
CSS

1 Comments(s)

Copy linkTweet thisAlerts:
@KDLAFeb 07.2007 — So what you want is something like this --
<i>
</i>image image image
text text text

right?

The easiest thing might be to do this with an inline list.

<i>
</i>ul {margin: 0; padding: 0; width: 100%;}
ul li {list-style-type: none; display: inline; width: 33%; margin: 0; padding: 0;}

<i>
</i>&lt;ul&gt;
&lt;li&gt;&lt;img src="file.jpg" /&gt;&lt;br /&gt;&lt;a href=""&gt;text&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;img src="file.jpg" /&gt; &lt;br / &gt;&lt;a href=""&gt;text&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;img src="file.jpg" /&gt; &lt;br /&gt; &lt;a href=""&gt;text&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
×

Success!

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