This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

Center No comments yet
#1

Comments, Add Comment, Open the form and the comments are all centered on my web pages. However, I can't get the "No comments yet" to center. The suggestions on the forum regarding centering elements have not solved my problem. When I added text-align: center to .cmtx_no_commentx_text in the css file, the "No comments yet" still stays on the left side of the page. If I add other variables such as changing the font color, the changes work.


I believe I'm using version 2.3.

You can view my website here.

Thanks for you help.

Jim
Reply
#2

Hi Jim,

You'll need to change the HTML from a span to a div in the template file. In /comments/includes/template/comments.php, change this (line 304):

PHP Code:
<?php 
echo "<span class='cmtx_no_comments_text'>";
echo
CMTX_NO_COMMENTS;
echo
"</span>";

To this:

PHP Code:
<?php 
echo "<div class='cmtx_no_comments_text'>";
echo
CMTX_NO_COMMENTS;
echo
"</div>";

Have you completed the interview?
Reply
#3

Thank you, Steven. The change worked perfectly. I appreciate your help.

Could you tell me why a span was used for the cmtx_no_comments_text but wasn't used with cmtx_comments_heading or cmtx_form_heading.

Thanks again. Commentics is a great program.

Jim
Reply
#4

Probably because a <span> tag is more semantic for a piece of text than a <div>, but <span> has the disadvantage that it's not a block level element so it can't be positioned properly.

cmtx_comments_heading and cmtx_form_heading use <h3> tags because that's the best and most appropriate tag for headings and is block level so can be positioned fine.

Have you completed the interview?
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by Tim
06-Jan-2021, 08:56 PM
Last Post by Tim
18-Oct-2019, 11:45 AM
Last Post by Gevill
23-Jul-2019, 01:17 AM
Last Post by Steven
16-Feb-2018, 09:15 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)