一、把文字做成图片,然后将图片作为背景。当然这样的话文字是没办法动态生成的。
二、把文字层作为底层,上层放内容。
举个例子:
.page{
width:100px
height:100px
position:relative}
.textbg{
position:absolute
left:0px
top:0px
width:100px
height:100px
z-index:-1
color:#999999
}
<div class="page">
<div class="textbg">背景文字背景文字背景文字背景文字背景文字背景文字背景文字背景文字背景文字背景文字背景文字背景文字</div>
<span>内容文字内容文字内容文字</span>
</div>
假如你的html代码是这样<div class="text">带背景的文字</div>你的css可以这样写:
.text {
background:url(images/xx.jpg)
}
仅供参考,具体的要看你的需求来改。