图像连接在一起,正确对齐

时间:2017-04-07 05:40:25

标签: php twitter-bootstrap

我试图通过修改100x100到200x200的vqmod来调整类别的图像,这就是发生的事情,我使用display:block,float:left;但我很难解决它。

我也尝试调整col-sm-2并且我添加了d-inline并且它不起作用。而不是使用CSS代码或样式表,我在这里添加了代码。有人可以告诉我修复它的代码吗?谢谢你和所有人的问候

here is the image



<modification>
	<id>Subcategory Images for OC 2.0</id>
	<version>1.0</version>
	<vqmver>1.2.3</vqmver>
	<author>vger.co.uk</author>
	
	<file name="catalog/controller/product/category.php">
        <operation>
            <search position="replace" index="1" offset="3"><![CDATA[
$data['categories'][] = array(
            ]]></search>
            <add><![CDATA[
				if ($result['image']) {
					$image = $this->model_tool_image->resize($result['image'], 200, 200);
				} else {
					$image = $this->model_tool_image->resize('placeholder.png', 100, 100);
				}
				
				$data['categories'][] = array(
					'name'  => $result['name'] . ($this->config->get('config_product_count') ? ' (' . $this->model_catalog_product->getTotalProducts($filter_data) . ')' : ''),
					'href'  => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url),
					'thumb' => $image
				);
            ]]></add>
        </operation>
	</file>
	
	<file name="catalog/view/theme/*/template/product/category.tpl">
        <operation>
            <search position="replace" index="1" offset="25"><![CDATA[
<?php if ($categories) { ?>
            ]]></search>
            <add><![CDATA[
<?php if ($categories) { ?>
	<div class="col-sm-12">
	  <div>
		<h3><?php echo $text_refine; ?></h3>
	  </div>
	  <div style="text-align: center;">
		<div class="row">
		<?php foreach ($categories as $category) { ?>
		  <div class="col-sm-2 col-xs-6 d-inline" style="margin-bottom: 20px;">
			<a href="<?php echo $category['href']; ?>"><img src="<?php echo $category['thumb']; ?>" alt="<?php echo $category['name']; ?>" /></a>
			<a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
		  </div>
		<?php } ?>
		</div>
	  </div>
	</div>
<?php } ?>
            ]]></add>
        </operation>
	</file>
	
</modification>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:0)

&#13;
&#13;
<div class="img-responsive inline-block;" style="border:">
				<a href="<?php echo $category['href']; ?>"><img src="<?php echo $category['thumb']; ?>" alt="<?php echo $category['name']; ?>" /></a>
			</div>
&#13;
&#13;
&#13;