Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>To remove all whitespace between images like you want, <code>float</code> won't work. You could create three <em>column</em> <code>&lt;div&gt;</code> tags and place your images within those columns. For instance, if you want three columns:</p> <p>HTML:</p> <pre><code>&lt;div class="imgCol"&gt; &lt;!-- every third image --&gt; &lt;/div&gt; &lt;div class="imgCol"&gt; &lt;!-- every third image --&gt; &lt;/div&gt; &lt;div class="imgCol"&gt; &lt;!-- every third image --&gt; &lt;/div&gt; </code></pre> <p>Then, add <code>float: left;</code> to the CSS for your column class (in this case <code>.imgCol</code>) and ensure the widths and margins are such that the columns appear side by side and no float drop occurs.</p> <p>Here's a demo: <strong><a href="http://jsfiddle.net/yLRWK/" rel="nofollow">http://jsfiddle.net/yLRWK/</a></strong></p> <p>For your particular situation, you could implement this as follows. I don't code in ASP.net, so there is some pseudocode thrown in</p> <pre><code>&lt;div class="Forum"&gt; &lt;p&gt;The Forum&lt;/p&gt; &lt;div class="imgCol"&gt; /* create counter = 0 */ @foreach (var item in Model) { /* if counter % 3 == 0, then write img tag */ &lt;img src="@item.Blog.Image.img_path" alt="Not Found" /&gt; /* counter++ */ } &lt;/div&gt; &lt;div class="imgCol"&gt; /* create counter = 0 */ @foreach (var item in Model) { /* if counter % 3 == 1, then write img tag */ &lt;img src="@item.Blog.Image.img_path" alt="Not Found" /&gt; /* counter++ */ } &lt;/div&gt; &lt;div class="imgCol"&gt; /* create counter = 0 */ @foreach (var item in Model) { /* if counter % 3 == 2, then write img tag */ &lt;img src="@item.Blog.Image.img_path" alt="Not Found" /&gt; /* counter++ */ } &lt;/div&gt; &lt;/div&gt; </code></pre> <p>There may be a better solution that does not require looping through the images three times, but that is best left to someone that better knows ASP.net</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload