Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-07-21 06:22:56

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

[SOLVED] imgs in lis - some css help please

I have something like

<ul>
<li ><img src="image.jpg" />
<p><em>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</em></p>
</li>
...
</ul>

What I am trying is to centre the li img and have the li p in text-align:left. The left alignment is not a problem as that is the default one, but how do I centre the img with css?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#2 2010-07-21 07:32:07

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: [SOLVED] imgs in lis - some css help please

As long as the image is inline, not floating, not position outside the normal flow nor displayed as a block, text-align will effect it too. For example:

li {
	text-align: center;
}
li p {
	text-align: left;
}

Offline

#3 2010-07-21 07:42:03

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: [SOLVED] imgs in lis - some css help please

Thanks Jukka,

Was thinking of it the wrong way. Your method worked beautifully (as always:)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB