我正在完成我的网站 http://centrosokoladine.lt/你可以看到中间左边有一些覆盖着文字的图片,我需要将该文字换行。图像设置就像那些盒子的背景图像,中间没有重复...
这里是 html 的确切部分:
<div class="turinio"><?php the_content(); ?></div>
和CSS:
.vidinis
{
background-color:#a68e84;
layer-background-color:#a68e84;
width: 709px;
/* height: 306px; */
align: center;
padding-top: 17px;
visibility: visible;
**background-image: url('http://centrosokoladine.lt/wp-content/themes/sokoladine/grafika/info.gif');
background-repeat: no-repeat;
word-wrap: break-word;
background-position: bottom left;**
overflow:hidden;
}
我知道它不可能在背景图像周围换行文本,所以我在这里寻找其他解决方案,也许我已经尝试为该图像创建单独的 div,但我失败了..
最佳答案
您不能使用背景图像执行此操作,除非 (1) 您为您的 div 提供了 padding-bottom 并且不在图像旁边显示文本,或者 (2) 您提供了padding-left 到您的 div,并且不在图像下方显示文本。
img
元素是执行此操作的正常 (html) 方法。然后,您可以将 align
属性添加到该图像。
关于css - 文字换行 [CSS],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8593780/