1. You should use a div around the image instead of a span, because a div implies that it’s a block instead of inline. And you can only float blocks. Also, you should not wrap it in strong tags. It’s an image, strong has no meaning around it.
2. Your code says class="commenttext"
but then you reference it like an id (using # instead of . as the prefix). Which is it?
In other words, you should be using .commenttext .avatar
with that HTML.
3. It really is more helpful to simply provide people with a link to the actual site. They don’t need to see code snippets to help with CSS problems, CSS issues can only be really solved by looking at a real live site having the problem.
As soon as you mentioned the ID versus the Class it, I found my mistake right away. Thanks!
(@slobizman)
15 years, 7 months ago
I could use some help on getting a gravatar into the right spot in my comments; I’m not much of a CSS person.
I am using the Whitespace theme. It didn’t come with avatar support, and I am trying to add it somewhere that makes sense in the comments. I am trying to place at the top left within the comment text display box (#commenttext) and wrap the comment text around it.
Here is the avatar class I made:
Here is the comments.php snippet. I’ve added the bolded code:
I used SPAN, but also tried DIV.
The problem is that the comment text area shows the image at the top left, but then the comment text begins below the image, not wrapping around it.