html:
<div id="id1">
this is my text1.
</div>
<div id="id2">
this is my text2.
</div>
CSS:
<style>
#id1 {
margin: 0 auto;
width: 600px;
background-color:#00FFCC;
}
#id2 {
margin: 0 auto;
width: 600px;
background-color:#FFCCCC;
}
</style>
在前面,它显示:
this is my text1. (green background)
this is my text2. (pink background)
现在,如果我希望它显示如下:
this is my text1. this is my text2. (green background)
empty in pink background
所以如果不更改html代码,是否可以仅通过css实现?基本上我想要做的是将 text: 移动this is my text2.
到第一个 div:<div id="id1"></div>