big CSS-trouble! aligning in listitem!

S

Sebastian Fey

hi,

im displaying little admonition-images (all 50px*50px) at the right of
<p>-tags by using

<img style="float:right">...

<p style="margin-right:70px">...

it works really fine, but when i to do the same in a listitem. the text
is now not longer aligned to the top of the image, but to the bottom!

this .html is created from XML by XSLT. so its impossible to give the first
<p> a special style, eg display:inline,
(btw if there is a way in CSS1 to access the first-child my problem is
solved )

i really tried everything, but im a newbe to CSS, so i hope anyone here can
help. im really fed up with this *******



thx a lot :)

-seb

here you can see the problem:
http://mitglied.lycos.de/buergerkonvent/test/li_prob.html




<html>

<style type="text/css">

div.admonright {margin-right:70px;}

p {margin-right:70px;}

img.admonright {float:right;}



</style>

<body>

<div>

<img class="admonright" src="../../common%20icons/tip.jpg">

<p>this is a para with a admonition-image at the right. works fine here. the
text is aligned to the top of the image! but look at the list below ... same
code, but aligning differs!</p>

<p>normal para anything this does is not to float to the very right, cause
this area is reserved to admonition-images</p>

</div>





<ul>

<li>

<p>normal item, aligned to the bullet, as it should be - looks great :)</p>

</li>

<li>

<img class="admonright" src="../../common%20icons/tip.jpg" />

<p>noooo i want to be aligned to my beloved bullet!</p>

<p>this is almost the same code as in the div above, but here the text is
aligned to the bottom of the image. anything i do, it will stay here.
shit!!</p>

</li>

</ul>

</body>

</html>
 
R

rf

Sebastian Fey said:
hi,

im displaying little admonition-images (all 50px*50px) at the right of
<p>-tags by using

<img style="float:right">...

<p style="margin-right:70px">...

it works really fine, but when i to do the same in a listitem. the text
is now not longer aligned to the top of the image, but to the bottom!

this .html is created from XML by XSLT. so its impossible to give the first
<p> a special style, eg display:inline,
(btw if there is a way in CSS1 to access the first-child my problem is
solved )

i really tried everything, but im a newbe to CSS, so i hope anyone here can
help. im really fed up with this *******

Remove the <p> etc from around the text starting with noooo. The block level
p element appears to be interfeering with the right float.

BTW do you think you can get a host that sprays more adds at me. I can still
almost tell which part of the page is yours and which is your hosts rubbish
:)

Cheers
Richard.
 
L

Lauri Raittila

Sebastian Fey said:
hi,

im displaying little admonition-images (all 50px*50px) at the right of
<p>-tags by using

<img style="float:right">...

<p style="margin-right:70px">...

when i to do the same in a listitem. the text
is now not longer aligned to the top of the image, but to the bottom!

Not here. Opera 7.2b1. What browser you use? Try making all possible
margins/paddings 0.
this .html is created from XML by XSLT. so its impossible to give the first
<p> a special style, eg display:inline,

Even more likely you should try remove P's top margin. (you don't need
top margin, as long as you have bottom margin.)

And, I think you are wrong about impossible.
(btw if there is a way in CSS1 to access the first-child my problem is
solved )

There isn't. And you propably mean widely supported way, not CSS1 way.
i really tried everything, but im a newbe to CSS, so i hope anyone here can
help. im really fed up with this *******

Don't use inline styles.

[snip invalid HTML. Please use doctype definition for full html page
snippets]
 
J

Jacqui or (maybe) Pete

hi,

im displaying little admonition-images (all 50px*50px) at the right of
<p>-tags by using

<img style="float:right">...

<p style="margin-right:70px">...

it works really fine, but when i to do the same in a listitem. the text
is now not longer aligned to the top of the image, but to the bottom!
....

here you can see the problem:
http://mitglied.lycos.de/buergerkonvent/test/li_prob.html
....snip code

Looks OK to me (I just fixed your syntax & made it html4.01 compliant):

http://porjes.haxorz.org/fright.html
 
S

Sebastian Fey

Lauri Raittila said:
Not here. Opera 7.2b1. What browser you use? Try making all possible
margins/paddings 0.

im using IE6, and this the only browser we support.
Even more likely you should try remove P's top margin. (you don't need
top margin, as long as you have bottom margin.)

well, nice! i tried this before to set the top-margin to 0...useless!
after your response i gave it a new try and... see this evil workaround =)

li.admon p {margin-top: -1em; /*!! im fed up with this shit and will use it
like this!!*/
margin-right:70px;}

so thank u very much :)


And, I think you are wrong about impossible.
right :) "nichts ist unmöglich"


THX!
 
S

Sebastian Fey

thx pete ... but this looks just the same as mine - IN IE6(!)
but i found a workaround!

thx
 
C

Chris Harris

when i to do the same in a listitem. the text
im using IE6, and this the only browser we support.

I presume that you are having a laugh !! Not funny, but rather silly
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top