为什么<span>超过<div>宽度?

时间:2017-08-13 00:43:29

标签: css

如何让<span>位于包含图片的<div>内?右边太长了。

  .image-container {
        position: relative;
        display: inline-block;
    }

    .image-container img {display: block;}

        .image-container .after {
            display: block;

        }
        .image-container .after .content {
            position: absolute;
            background-color: #C0D8D8;
            bottom: 0;
            text-align: center;
            padding: 0px;
        }


<div class="after">
                <div class="content"><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">this is some content. It can be long and span several lines.</a></div>
            </div>

the width of the text box is larger than the div that contains the image

1 个答案:

答案 0 :(得分:0)

试试这个:

<div class="after">
    <img src="http://justcuteanimals.com/wp-content/uploads/2016/10/baby-bear-pictures-cute-animal-pics.jpg">
    <span class="content"><a href="#">this is some content. It can be long and span several lines.this is some content. It can be long and span several lines.this is some content. It can be long and span several lines.this is some content. It can be long and span several lines.</a>
    </span>
</div> 
x=rnorm(100,0,1)
x
a=0
for(i in x){
  if(i in -1:1){
    a<-a+1
  }
}