Monday, March 28, 2011

Custom Wordpress Themes: Fix the Comment Box Width

When coding several custom Wordpress themes, the default width of the comments box in comments.php was breaking my table layout. To fix this, I simply changed the width of the textarea tag.

Here is the original code from comments.php (Wordpress 2.7)


<textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4">



Here are two options to fix the width issue.

Change the "cols" value:


<textarea name="comment" id="comment" cols="40" rows="10" tabindex="4"></textarea>



Or, remove the "cols" value and add a specific width:


<textarea name="comment" id="comment" style="width: 400px;" rows="10" tabindex="4">

No comments:

Post a Comment

Only comments in English will be considered. Thank you!