3

需要您的帮助,使用在线内联样式为 XHTML 中的 2 列布局编写正确的代码。

本质上,我正在尝试重新设计我的公司 wiki 的概述页面,使其具有 2 列布局,每列中的链接将用户带到 wiki 的不同部分。

由于我对 XHTML 了解不多,所以我使用的是 HTML + 转换器。当我将 HTML 转换为 XHTML 并将其输入到 wiki 页面时,我的块元素最终会相互重叠。这是我写的,任何指针将不胜感激:

<body>
<div id="left" style="display: block;"> 
    <ul style="float:left; width:300px; height:400px;">
        <a href=""> 
        <img src=""> </a> </br>

        <h4>Ways to Get Involved</h4> </br>
        <a href="">Design Thinking with Jacquelyn</a> </br>
        <a href="">Running Meetings </a> </br>
        <a href="">Preparing and Running Playbacks</a> </br>
        <a href="">Working with Users</a> </br>
        <a href="">See all topics</a> </br>

        <a href=""> 
        <img src=""> </a> </br>


        <a href=""> </br> Find and share useful tools for day-to-day design     work</a> </br>  

    </ul>

</div>



<div id="right" style="float: left; width: 300px; height:400px;"> 
    <ul style="float:left">
      <a href=""> 
        <img src=""> </a> </br>

        <h4>Latest Posts</h4>
        <a href="">Slimming down on features for a more delightful experience</a> </br>
        <a href="">CitiBike: First 100 Days Visualized</a> </br>
        <a href="">Development and Design Go Hand-in-Hand When Creating Smarter Cities</a> </br>
        <a href="">Story 2.0: The Surprising Thing About the Next Wave of Narrative</a> </br>
        <a href="">See all blog posts</a> </br>

          <a href=""> 
        <img src=""> </a> </br>

        <a href="">Get engaged, educated and empowered to do Design Thinking</a>

无论如何-非常感谢任何/所有帮助。我在 EOD 星期五(今天)截止日期之前。

4

2 回答 2

1

You can set the container divs to width="45%". This will let them both fit in the overall 100% of the screen, but will also allow some room for padding.

Floating one left and the other right will help, I guess. I would rather use display:inline-block; though.

Here, have a fiddle.

于 2013-11-01T16:49:46.110 回答
0

利用 :

style="float: left; width: 300px; height:400px;"

仅在外部 DIV 上。不要浮动内容(UL)

顺便说一句:内联样式也是CSS。

于 2013-11-01T16:45:25.440 回答