Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-03-19 03:29:09

juliane
Member
Registered: 2009-02-08
Posts: 33

icon image through css

hi,

i’m trying to put an icon before comments_invite using css image replacement.

so I wrote this:
.comment-icon { background:url(images/comment-icon.png) 1px no-repeat;padding-left:11px;color:#999999;}

how should I write the code on the form before <txp:comments_invite /> ?

i tried <div class=“comment-icon”></div> but did not work.

thank you!

Offline

#2 2009-03-19 09:59:05

kemie
Plugin Author
From: mexico<-->sweden
Registered: 2004-05-20
Posts: 495
Website

Re: icon image through css

try inserting a &nbsp; inside the div. a completely empty div might not render at all


~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~

Offline

#3 2009-03-19 13:56:42

nemoorange
Plugin Author
From: Washington DC
Registered: 2006-11-29
Posts: 90
Website

Re: icon image through css

.comment-icon might not have any height. try adding height: 20px; and see if that makes any difference.


Txp admin themes | dropshado.ws – a blog for design noobs like me

Offline

#4 2009-03-19 17:48:04

juliane
Member
Registered: 2009-02-08
Posts: 33

Re: icon image through css

still not working.
tried both: <div class=“comment-icon”>&nbsp;</div> and height: 20px.

what is wrooong? :/

Offline

#5 2009-03-19 17:56:40

nemoorange
Plugin Author
From: Washington DC
Registered: 2006-11-29
Posts: 90
Website

Re: icon image through css

Are you sure you have the correct file path to the image? Try these:

url(/images/comment-icon.png)
url(../images/comment-icon.png)

and if that doesn’t work, I would put the full URL address in there.


Txp admin themes | dropshado.ws – a blog for design noobs like me

Offline

#6 2009-04-24 03:33:12

juliane
Member
Registered: 2009-02-08
Posts: 33

Re: icon image through css

yes. I think I have the correct path to image: http://wowlab.org/images/comment.png
.post-comment-icon { height: 20px; background:url(images/comment.png) no-repeat;padding-left:11px; }

the url is: http://wowlab.org

and I have this code now:
<span class=“post-comment-icon”>&nbsp;</span>
<span class=“post-comment-invite”><txp:comments_invite /></span>

whys not showing the icon?

thank you.

Offline

#7 2009-04-24 03:45:16

juliane
Member
Registered: 2009-02-08
Posts: 33

Re: icon image through css

also, how can I place the grey box (with comment author+invite) aligned to the bottom of the image of the article that is on the left?

Offline

#8 2009-04-24 08:17:06

kemie
Plugin Author
From: mexico<-->sweden
Registered: 2004-05-20
Posts: 495
Website

Re: icon image through css

julianne, do you have a sample online, or at least an image? Don’t really understand what “gray box” you are referring to, or exactly what it should be aligned with.


~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~

Offline

#9 2009-04-24 13:19:53

juliane
Member
Registered: 2009-02-08
Posts: 33

Re: icon image through css

I want the site to be aligned like this:

The gray box is where the comment author name and comments invite are. I want this aligned to the bottom of the article image. For every article.

Like this picture: http://wowlab.org/images/wowlab-aligned.jpg

Offline

#10 2009-04-24 15:37:57

kemie
Plugin Author
From: mexico<-->sweden
Registered: 2004-05-20
Posts: 495
Website

Re: icon image through css

you can set the container for your article with position: relative and the grey box with position:absolute; bottom:0; that way the gray box will always be aligned with the bottom of the article container


~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~

Offline

#11 2009-04-24 17:11:49

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: icon image through css

juliane wrote:

.post-comment-icon { height: 20px; background:url(images/comment.png) no-repeat;padding-left:11px; }

You didn’t add the slash like nemoorange said: background:url(/images/comment.png).

(The funny thing is that as soon as I open ‘edit CSS’ with the Webdeveloper extension, the icon appears, without having to change a thing…)

Offline

Board footer

Powered by FluxBB