Css 使文本格式正确且不在div列中换行

Css 使文本格式正确且不在div列中换行,css,html,text,Css,Html,Text,我只能找到如何做我的文本目前正在做的事情。不是阻止它。我希望文本不要在图像下换行。但是我不能使用固定的宽度。调整页面大小时,文本需要在同一列中继续 图像显示在此处 名称在div中与主文本一起出现 文本,我想留在它的it部门,而不是在下面的包装 图片在这里 最好的方法是使用表格 我刚刚将div复制到它们自己的表格单元格中 <table> <tr> <td> <strong><a href="http://cl

我只能找到如何做我的文本目前正在做的事情。不是阻止它。我希望文本不要在图像下换行。但是我不能使用固定的宽度。调整页面大小时,文本需要在同一列中继续


图像显示在此处
名称在div中与主文本一起出现

文本,我想留在它的it部门,而不是在下面的包装 图片在这里


最好的方法是使用表格

我刚刚将div复制到它们自己的表格单元格中

<table>
    <tr>
    <td>
        <strong><a href="http://climatemaryland.org/wp-content/uploads/2013/01/Casciani_Cheryl.jpg"><img class="alignleft  wp-image-131" style="border: 0px none;" alt="" src="http://climatemaryland.org/wp-content/uploads/2013/01/Casciani_Cheryl.jpg" width="166" /></a></strong>
    </td>
    <td>
        <p><strong>Cheryl Casciani</strong></p>
        <p>Cheryl Casciani is the Director of Neighborhood Sustainability for the
        Baltimore Community Foundation (BCF) where she is responsible for management
        of a range of initiatives aimed at strengthening Baltimore neighborhoods
        and making Baltimore a more sustainable city. Cheryl also serves as the
        Chair of the Baltimore Commission on Sustainability, which was created
        in 2008 and charged with developing and monitoring the implementation of
        Baltimore's Sustainability Plan. She has a Master's in Public and Private
        Management from the Yale School of Management and a Bachelors of Science
        in Economics and Bachelors of Applied Science from the University of Pennsylvania.</p>
    </td>
    </tr>


谢丽尔·卡斯基亚尼

Cheryl Casciani是社区可持续发展委员会的主任 巴尔的摩社区基金会(BCF)负责管理 一系列旨在加强巴尔的摩社区的举措 使巴尔的摩成为一个更具可持续性的城市。谢丽尔还担任首席执行官 成立的巴尔的摩可持续发展委员会主席 2008年,负责制定和监测 巴尔的摩的可持续发展计划。她在公共和私人领域都有硕士学位 耶鲁大学管理学院的管理学和理学学士 在经济学和宾夕法尼亚大学应用科学学士。< /P>

使用表格属性使其看起来更理想。

如果使用百分比宽度,如下所示:

#apDiv2 {
    float: left;
    padding-right: 2%;
    width: 38%;
    z-index: 2;
}


#apDiv3 {
    float: left;
    width: 60%;
    z-index: 3;
}
然后文本将继续在同一列中,即使调整窗口大小也是如此。只需确保在每次apDiv1之后清除浮标即可。要清除浮动,请添加类似于
的内容,其中clear类的css如下所示:

.clear { clear: both; }

我不能在apDiv1中清除它吗?既然float不适用于这里,并且它是父标记,那么它会清除它们吗?并与之分离。它仍然不能正常工作。可能是因为我试图在wordpress中实现它(我讨厌wordpress,但这是部门选择使用的)。
.clear { clear: both; }