Denoteone
Denoteone

Reputation: 4055

Format image inside of li

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>
   </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?

Upvotes: 0

Views: 792

Answers (1)

JacobTheDev
JacobTheDev

Reputation: 18520

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.

Upvotes: 1

Related Questions