/    Sign up×
Community /Pin to ProfileBookmark

text-align wont do, I want to align an image.

I’m trying to center an image and some text inside a list item to make a gallery. [i]text-align:ceneter;[/i] centers the text as one would expect, but I can’t think how to center the images as well. Anyone know the awnser?

Here’s more of the code I’m using, it’s [url=http://cherryblossomart.ntwebsite.net/gallery.php]on this page[/url].

[CODE]ul#gallery{padding: 0;}

ul#gallery li{
list-style-type: none;
float: left;
border: 1px solid;
margin: 10px;
padding: 5px;
text-align: center;
}

ul#gallery img{
display: block;
border: 0px;
}[/CODE]

to post a comment
CSS

3 Comments(s)

Copy linkTweet thisAlerts:
@FangFeb 22.2005 — ul#gallery img{
[COLOR=green]margin:auto;[/COLOR]
display: block;
border: 0px;
}
Copy linkTweet thisAlerts:
@the_treeauthorFeb 22.2005 — Thanks ? to be honest I don't get [i]why[/i] that works, but it seems to so I'll take it ?
Copy linkTweet thisAlerts:
@FangFeb 22.2005 — [I]auto[/I] expands the margins to the edges of the parent container.

and now the issues with the layout in all other browsers ... ?
×

Success!

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