开发者

Format image inside of li

开发者 https://www.devze.com 2023-03-14 08:49 出处:网络
My output from my CMS is putting my image inside of my <li> so everything is showing on the same line. The output looks like so:

My output from my CMS is putting my image inside of my <li> so everything is showing on the same line. The output looks like so:

    <li class="data_li">
       <a href="http://mywebsite.php">Buffalo</a> 
      <img width="363" height="136" src="http://mywebsite.php/images/BWR.jpg" class="thumbnail" alt="Buffalo" title="BWR" />
      <div class="teaser_text"></div>
   </开发者_JS百科li>

I would like to style the output so the elements are block (fall under each other)

Any ideas of how I would accomplish this?


so you could do

.data_li img {
    display: block;
}

Or

.data_li * {
    display: block;
}

depending on what you want. .data_li * should affect every child element, so anything within <li class="data_li"> should have a display: block; Obviously .data_li img will only affect the img elements within that div, like your title asked for.

0

精彩评论

暂无评论...
验证码 换一张
取 消