<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来实现?基本上我想要做的是移动文本:this is my text2.
到第一个div:<div id="id1"></div>
明显移动或实际改变内容? – FakeRainBrigand
是否需要在加载或某个事件(如悬停或单击)上进行更改?请明确点。 – AnaMaria
这是不可能的与CSS。这只能使用JavaScript或XSLT来完成。 – bot