2013-06-23 32 views
1

我有以下responsive blog archives layout,它存在對齊問題,但我不確定哪個元素可用於解決問題。Hyde產生的TB流體div對齊問題生成的代碼

在鏈接的jsFiddle example中,調整寬度確實會生成響應式佈局,但博客文章的列表不能正確對齊。

海德靜態網站生成器的下面的代碼似乎把多餘的<p>標籤放在裏面,我不確定它是否需要在那裏補救,或者如果一些CSS調整就足夠了。

{% extends "base.j2" %} 
{% from "macros.j2" import render_excerpt with context %} 
{% block main %} 
{% block page_title %} 

<h1 class="title"></h1> 

    <div class="page-header"> 
    <h1>{{ resource.meta.title }}</h1> 
    </div> 


{% endblock %} 


    <div class="row-fluid"> 

    {% for res in resource.node.walk_resources_sorted_by_time() %} 


    {% refer to res.url as post %} 

     <div class="span4"> 
       <a href="{{ content_url(res.url) }}"><h2>{{ res.meta.title }}</h2></a> 

    <a href="{{ content_url(res.url) }}" class="postpic">{{ post.image|markdown|typogrify }}</a> 

{{ res.meta.excerpt|markdown|typogrify }} 

       <p><a class="btn" href="{{ content_url(res.url) }}">View details &raquo;</a></p> 
      </div><!--/span--> 

    {% endfor %} 

      </div><!--/row--> 


{% endblock %} 
+1

爲用於生成頁面的語言添加標籤! ;) – rkpasia

回答

1

如果你想建立一個網格是最好的,每3個span4你生成一個新的行流體在另一個之下。例如:

<div class="row-fluid"> 
    <div class="span12"> //These two row are our flexible container 
    /GENERATE WITH YOUR CODE THIS STUCTURE UNDER EVERY 3 POST/
    <div class="row-fluid"> 
     <div class="span4"></div> 
     <div class="span4"></div> 
     <div class="span4"></div> 
    </div> 

我使用php做到這一點,但我認爲這是你的html在循環中的邏輯結構的一個小錯誤!

+0

謝謝,那整理出來了! –