0

私は懸命にグーグルで検索しましたが、それでもうまく見つけることができませんでした。

コードは次のとおりです。

          <div class="SingleNewsMain" news-type = "{$value.news_type_id}" >

                    <div class="NewsTitleMain">
                        <a href= "index.php?show_news={$value.id}"><!--{$value.title}-->Some random header</a>
                    </div>
                    <div class="NewsMainImage">
                        <a href="#">
                            <img src="img/13095.png">
                        </a>    
                    </div>  

                    <div class="NewsMainShort"> 
                        <!--{$value.short_text}-->
                        Some random description
                    </div>

                    <div class="NewsInfo">
                            <span>
                            <icon class="icon-eye-open"></i>
                            </span>
                            <span class="ViewsInfo">2100</span>                         

                            <span>
                            <icon class="icon-comment"></i>
                            </span>
                            <span class="CommentaryInfo"> 46</span>
                    </div>
                </div>

そして、ここに私のCSSがあります

.SingleNewsMain{
  border-bottom: 1px solid rgb(175,175,175);
}
.NewsTitle {
  font-size: 24px;
  padding-top: 20px;
  line-height: 27px;
  font-family: 'Playfair Display SC';
}

.NewsTitleMain {
  font-size: 24px;
  padding-top: 20px;
  line-height: 25px;
  font-family: 'Playfair Display SC';
}

.NewsMainImage{
  padding: 10px 10px 5px 0px;
  width: 200px;
  height: 110px;
  float: left;
  clear: both;
}
.NewsMainShort {
  font-size: 14px;
  padding-top: 5px;
  padding-bottom: 30px;
  position: relative;
}

また、最初の 2 つのスクリーンショット。.NewsMainShortプロパティを持っていますclear:both

http://imageshack.us/photo/my-images/833/x7cp.png/

そして2番目のもの.NewsMainShortはプロパティを持っていませんclear:both

http://imageshack.us/photo/my-images/96/jl29.png/

2番目のスクリーンショットのように見えることなく、テキストを単に画像の周りに巻き付けたい. Inspect Element in Chrome が示しているように、画像の DIV がないと高さclear:bothが収まらないことがわかります。SingleNewsMain

4

1 に答える 1