duanmei2459 2012-03-17 09:04
浏览 36

CSS文本背景跨度填充

I am trying to add a transparent png background to some dynamic text and give it 15 px padding all the way around the sentence.

As you can see from the photo the span class does not know how to add padding to text that does not have a line break. This text is part of a Views Slideshow and it changes every few seconds. I would like to add padding to the left,right, and after the break in the sentence. See the link sample. I heard that I may need to use php as it can count the characters and add padding. Does anyone know a way to do this. If I give this span class padding it only give padding to the front and end of the sentence but not after the line break.

http://visiongem.com/portfolio/span-class-help.jpg

The html and CSS are below:

.blueback {background-image:url(images/transparentback.png);}



<div id="sliderhome"><div id="slidertitle"><span class="blueback">[title]</span>
</div><div id="featureslider-list"><ul class="homepage-featureslider-list">
<span class="blueback"><li>[field_linkto_story_url]</li>
<li>[field_linkto_photo_url]</li>
<li>[field_linkto_video_url]</li></div>
</ul></span></div>
  • 写回答

2条回答 默认 最新

  • dtvam48220 2012-03-17 09:26
    关注

    add padding to the text and then display property as table

    .css{
        padding:10px;
        display:table;
    }
    
    评论

报告相同问题?

悬赏问题

  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)