Jump to content

Text not displaying correctly in Subcategories


jboras

Recommended Posts

Hi, can anyone tell us why the text is not showing correctly in subcategories?

 

eg: http://fujitech.asia/index.php?_a=category&cat_id=20

 

The Subcat description should be under the jpeg but it seems to flow just to the right of it.

 

Any suggestion would be greatly appreciated


The only change we did was:

 

#subcategories > div.subcategory {
display: inline-block;
height: 120px;
text-align: center;
vertical-align: top;
width: 92px;
 
clanged the with to 92 px so that the subcats take up the width of the skin in full rather squashed left
Link to comment
Share on other sites

In the template skin content.category.php, make the following edit:

Was:
  <div class="subcategory">
    <a href="{$subcat.url}" title="{$subcat.cat_name}">
      <img src="{$subcat.cat_image}" alt="{$subcat.cat_name}" />
    </a>
    <a href="{$subcat.url}" title="{$subcat.cat_name}">{$subcat.cat_name}</a>
  </div>
 
Now:
  <div class="subcategory">
    <a href="{$subcat.url}" title="{$subcat.cat_name}">
      <img src="{$subcat.cat_image}" alt="{$subcat.cat_name}" />
    </a><br />
    <a href="{$subcat.url}" title="{$subcat.cat_name}">{$subcat.cat_name}</a>
  </div>

The design of this subcategory block has an unrealized assumption that, because the image would take the full width of its container, the text would by necessity have to flow to the next line - below the image.

 

But, since the image does not necessarily take the full width of its container - as when the source image is much taller than it is wide - if a word of text can fit in the remaining space to the right of the image, it will do so.

 

Adding the <br /> tag will force a line break.
 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...