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>