2010-06-05 29 views
0

我想要在3列中收聽這些圖像(請參閱下方)。什麼是這個HTML鱈魚?在列中列出DIV標籤

[IMAGE] [IMAGE] [IMAGE]
<div class="rparticle "> 
    <div class="articleEntry Normal"><a href="[LINK]">[IMAGE]</a></div> 
    <div><a href="[LINK]">[TITLE]</a></div> 
</div> 

.rparticle 
{ 
display:inline; 
    clear: both; 
    text-align: center; 
    margin-bottom : 25px; 
width:190px; 
} 
+1

您可能會在Doctype.com上找到更多信息 – 2010-06-05 22:57:19

回答

1

讓我們讓他們浮到左邊或右邊。

... 
<head> 
    <style> 
     .rparticle{ 
      float: left; 
      width: 33%; 
      text-align: center; 
      margin-bottom : 25px; 
     } 
     .clear{ 
      clear: both; 
     } 
    </style> 
</head> 
<body> 
    <div class="rparticle"> 
     <div class="articleEntry Normal"><a href="[LINK]">[IMAGE1]</a></div> 
     <div><a href="[LINK]">[TITLE]</a></div> 
    </div> 
    <div class="rparticle"> 
     <div class="articleEntry Normal"><a href="[LINK]">[IMAGE2]</a></div> 
     <div><a href="[LINK]">[TITLE]</a></div> 
    </div> 
    <div class="rparticle"> 
     <div class="articleEntry Normal"><a href="[LINK]">[IMAGE3]</a></div> 
     <div><a href="[LINK]">[TITLE]</a></div> 
    </div> 
    <br class="clear" /> 
</body> 
... 
+0

謝謝!這項工作,但[IMAGE]指出了獨特的形象。播種此代碼打印每行中3個相似的圖像。有沒有什麼辦法可以讓這段代碼在列的每一行上打印一個uniuqe圖像? – user265767 2010-06-05 23:08:22

+0

你用什麼來生成[IMAGE]標籤持有者?無論它是什麼語言,你都可以使用循環! – sepehr 2010-06-05 23:12:09

+0

這是一個DotNetNuke文章模塊。而這個HTML是爲自己的樣式上市文章。以下是我可以在HTML樣式中使用的令牌列表。 http://www.ventrian.com/Support/ProductForums/tabid/118/forumid/4/postid/5025/view/topic/Default.aspx – user265767 2010-06-05 23:24:45

0

這只是可能的,如果容器和孩子有width和孩子們floatleft。這裏有一個copy'n'paste'n'runnable SSCCE它演示它。

<!doctype html> 
<html lang="en"> 
    <head> 
     <title>SO question 2982423</title> 
     <style> 
      #container { 
       width: 750px; 
      } 
      #container .image { 
       float: left; 
       width: 250px; 
      } 
     </style> 
    </head> 
    <body> 
     <div id="container"> 
      <div class="image"><img src="http://sstatic.net/so/img/logo.png"></div> 
      <div class="image"><img src="http://sstatic.net/so/img/logo.png"></div> 
      <div class="image"><img src="http://sstatic.net/so/img/logo.png"></div> 
      <div class="image"><img src="http://sstatic.net/so/img/logo.png"></div> 
      <div class="image"><img src="http://sstatic.net/so/img/logo.png"></div> 
     </div> 
    </body> 
</html>