0

我在为班级创建的项目中有一个页面,我想在左侧对齐图像,右侧的文本在图像中间对齐。我决定在我的外部 CSS 中尝试使用内部 CSS div 元素,而不是使用 html 元素。我的问题是我无法让它们垂直对齐。我有水平对齐,但文本要么出现在图像上方一行,要么出现在图像下方一行。我尝试了这篇文章中包含的技术,但它们并没有解决我的问题。 并排对齐 <div> 元素

这是我的内部 CSS。

<style type="text/css">
/* left div holding the image */
#left {
width:170px;
align:left;  }

/* right div to hold the text */
#right {
margin-left: 200px;
text-align:left; }
</style>

这是HTML

<div id="content">
<br/>
<br/>
<br/>
<blockquote>
<div id="right">Check back soon.  <a href="mailto:TwoWiredChicksJewelry@gmail.com?subject=AlertWhenPageComplete">Click here</a> to receive an email when the site becomes available.</div><div id="left"><img src="images/construction-clipart.jpg" border="1" alt="Page under construction" /></div>
</blockquote>
</div>

你能帮我弄清楚如何使这些对齐吗?要查看它的渲染方式,请访问我的学生项目网站http://www.student.nvcc.edu/home/ligomes/TwoWiredChicks/Browse.html

谢谢!

4

1 回答 1

0

最后,我希望这对现在有所帮助。对于正确的 CSS,您所拥有的只是:

#right {

    position: absolute;
    margin-left: 200px

}
于 2013-08-08T05:24:53.520 回答