画像、タイトル、作成者、説明などの記事の詳細を 3x2 形式のマトリックスで表示する必要があります。
以下を使用class
して記事の詳細をラップします
#article2x3-article-wrapperHP
{
float:left;
width:233px;
height:340px;
background-color:#ccc;
vertical-align:middle;
margin-right:25px;
}
このクラスには margin-right: 25px があり、これがmargin-right:25px;
すべての div に追加され、デザインが壊れ、コンテナーの幅が750px
1 つしかありません。
margin-right:0px;
デザインを修正するために jquery を使用して割り当てることを考えましたが、うまくいきません。margin-right: 0px;
jqueryを使用して3番目と6番目のDIVに割り当てることができるようにjqueryを修正するにはどうすればよいですか
$(function () {
$(".article2x3-outer-wrapperHP div:eq(3)").css("margin-right", "0px");
$(".article2x3-outer-wrapperHP div:eq(6)").css("margin-right", "0px");
});
以下は、デザイン用のサンプル HTML コードです。
<div id="article2x3-outer-wrapperHP">
<div id="article2x3-HPTitle">
<span id="MainContent_LatestTopSixArticles_lblArticle2x4Title">Current Articles</span>
</div>
<div id="article2x3-article-wrapperHP">
<div id="article2x3-image">
<img src="../images/article/9f07eb06-7f9d-4f68-92e1-d99ea36ebb65.png" class="imgArticle2x3Image" id="MainContent_LatestTopSixArticles_rptTopSixArticles_imgArticle2x3Image_0">
</div>
<div id="article2x3-title">
<span class="lblArticle2x3Title" id="MainContent_LatestTopSixArticles_rptTopSixArticles_lblArticle2x3Title_0">Article One</span>
</div>
<div id="article2x3-author">
<span class="lblArticle2x3Author" id="MainContent_LatestTopSixArticles_rptTopSixArticles_lblArticle2x3Author_0">by Author</span>
</div>
<div id="article2x3-desc">
<span class="lblArticle2x3Desc" id="MainContent_LatestTopSixArticles_rptTopSixArticles_lblArticle2x3Desc_0">My admiration for the amazing achievemen...</span>
</div>
</div>
<div id="article2x3-article-wrapperHP">
<div id="article2x3-image">
<img src="../images/article/9f07eb06-7f9d-4f68-92e1-d99ea36ebb65.png" class="imgArticle2x3Image" id="MainContent_LatestTopSixArticles_rptTopSixArticles_imgArticle2x3Image_0">
</div>
<div id="article2x3-title">
<span class="lblArticle2x3Title" id="MainContent_LatestTopSixArticles_rptTopSixArticles_lblArticle2x3Title_0">Article One</span>
</div>
<div id="article2x3-author">
<span class="lblArticle2x3Author" id="MainContent_LatestTopSixArticles_rptTopSixArticles_lblArticle2x3Author_0">by Author</span>
</div>
<div id="article2x3-desc">
<span class="lblArticle2x3Desc" id="MainContent_LatestTopSixArticles_rptTopSixArticles_lblArticle2x3Desc_0">My admiration for the amazing achievemen...</span>
</div>
</div>
<div id="article2x3-article-wrapperHP">
<div id="article2x3-image">
<img src="../images/article/9f07eb06-7f9d-4f68-92e1-d99ea36ebb65.png" class="imgArticle2x3Image" id="MainContent_LatestTopSixArticles_rptTopSixArticles_imgArticle2x3Image_0">
</div>
<div id="article2x3-title">
<span class="lblArticle2x3Title" id="MainContent_LatestTopSixArticles_rptTopSixArticles_lblArticle2x3Title_0">Article One</span>
</div>
<div id="article2x3-author">
<span class="lblArticle2x3Author" id="MainContent_LatestTopSixArticles_rptTopSixArticles_lblArticle2x3Author_0">by Author</span>
</div>
<div id="article2x3-desc">
<span class="lblArticle2x3Desc" id="MainContent_LatestTopSixArticles_rptTopSixArticles_lblArticle2x3Desc_0">My admiration for the amazing achievemen...</span>
</div>
</div>
<div id="article2x3-article-wrapperHP">
<div id="article2x3-image">
<img src="../images/article/9f07eb06-7f9d-4f68-92e1-d99ea36ebb65.png" class="imgArticle2x3Image" id="MainContent_LatestTopSixArticles_rptTopSixArticles_imgArticle2x3Image_0">
</div>
<div id="article2x3-title">
<span class="lblArticle2x3Title" id="MainContent_LatestTopSixArticles_rptTopSixArticles_lblArticle2x3Title_0">Article One</span>
</div>
<div id="article2x3-author">
<span class="lblArticle2x3Author" id="MainContent_LatestTopSixArticles_rptTopSixArticles_lblArticle2x3Author_0">by Author</span>
</div>
<div id="article2x3-desc">
<span class="lblArticle2x3Desc" id="MainContent_LatestTopSixArticles_rptTopSixArticles_lblArticle2x3Desc_0">My admiration for the amazing achievemen...</span>
</div>
</div>
<div id="article2x3-article-wrapperHP">
<div id="article2x3-image">
<img src="../images/article/9f07eb06-7f9d-4f68-92e1-d99ea36ebb65.png" class="imgArticle2x3Image" id="MainContent_LatestTopSixArticles_rptTopSixArticles_imgArticle2x3Image_0">
</div>
<div id="article2x3-title">
<span class="lblArticle2x3Title" id="MainContent_LatestTopSixArticles_rptTopSixArticles_lblArticle2x3Title_0">Article One</span>
</div>
<div id="article2x3-author">
<span class="lblArticle2x3Author" id="MainContent_LatestTopSixArticles_rptTopSixArticles_lblArticle2x3Author_0">by Author</span>
</div>
<div id="article2x3-desc">
<span class="lblArticle2x3Desc" id="MainContent_LatestTopSixArticles_rptTopSixArticles_lblArticle2x3Desc_0">My admiration for the amazing achievemen...</span>
</div>
</div>
<div id="article2x3-article-wrapperHP">
<div id="article2x3-image">
<img src="../images/article/9f07eb06-7f9d-4f68-92e1-d99ea36ebb65.png" class="imgArticle2x3Image" id="MainContent_LatestTopSixArticles_rptTopSixArticles_imgArticle2x3Image_0">
</div>
<div id="article2x3-title">
<span class="lblArticle2x3Title" id="MainContent_LatestTopSixArticles_rptTopSixArticles_lblArticle2x3Title_0">Article One</span>
</div>
<div id="article2x3-author">
<span class="lblArticle2x3Author" id="MainContent_LatestTopSixArticles_rptTopSixArticles_lblArticle2x3Author_0">by Author</span>
</div>
<div id="article2x3-desc">
<span class="lblArticle2x3Desc" id="MainContent_LatestTopSixArticles_rptTopSixArticles_lblArticle2x3Desc_0">My admiration for the amazing achievemen...</span>
</div>
</div>
</div>
私は実際のWebページはasp.net-webformであり、リピーターコントロールを使用してこのdivを作成しています.jQueryを使用してフロントエンドで実行する方が便利なので、.csファイルで実行したくありません