下面是我的XML结构,我正在尝试使用CSS在其上应用样式。对于定位,我必须使用浮点数。我知道更好的方法,但是在这种情况下,我必须使用浮点数。 (它具有偶数个<Class>
元素块)
<College>
<Class>
<Module>Class 0</Module>
<Students>
<Student>
<Name>Student 0</Name>
<Email>s0@example.com</Email>
</Student>
</Students>
</Class>
<Class>
<Module>Class 0</Module>
<Students>
<Student>
<Name>Student 0</Name>
<Email>s0@example.com</Email>
</Student>
</Students>
</Class>
<Class>
<Module>Class 1</Module>
<Students>
<Student>
<Name>Student 1</Name>
<Email>s1@example.com</Email>
</Student>
</Students>
</Class>
<Class>
<Module>Class 2</Module>
<Students>
<Student>
<Name>Student 2</Name>
<Email>s2@example.com</Email>
</Student>
</Students>
</Class>
<Extra>
<Class>
<Module>Class 3</Module>
<Students>
<Student>
<Name>Student 3</Name>
<Email>s3@example.com</Email>
</Student>
<Student>
<Name>Student 4</Name>
<Email>s4@example.com</Email>
</Student>
</Students>
</Class>
<Class>
<Module>Class 4</Module>
<Students>
<Student>
<Name>Student 4</Name>
<Email>s4@example.com</Email>
</Student>
<Student>
<Name>Student 5</Name>
<Email>s5@example.com</Email>
</Student>
</Students>
</Class>
</Extra>
下面是<Class>
个元素块为奇数的代码
<College>
<Class>
<Module>Class 0</Module>
<Students>
<Student>
<Name>Student 0</Name>
<Email>s0@example.com</Email>
</Student>
</Students>
</Class>
<Class>
<Module>Class 1</Module>
<Students>
<Student>
<Name>Student 1</Name>
<Email>s1@example.com</Email>
</Student>
</Students>
</Class>
<Class>
<Module>Class 2</Module>
<Students>
<Student>
<Name>Student 2</Name>
<Email>s2@example.com</Email>
</Student>
</Students>
</Class>
<Extra>
<Class>
<Module>Class 3</Module>
<Students>
<Student>
<Name>Student 3</Name>
<Email>s3@example.com</Email>
</Student>
<Student>
<Name>Student 4</Name>
<Email>s4@example.com</Email>
</Student>
</Students>
</Class>
<Class>
<Module>Class 4</Module>
<Students>
<Student>
<Name>Student 4</Name>
<Email>s4@example.com</Email>
</Student>
<Student>
<Name>Student 5</Name>
<Email>s5@example.com</Email>
</Student>
</Students>
</Class>
</Extra>
为什么设计打破了奇数个元素?用浮子实现这种定位的更好方法是什么。我的目标是将<Classs>
个元素块左右交替放置。