gpt4 book ai didi

html - 坚持使用CSS定位图像

转载 作者:行者123 更新时间:2023-11-28 08:08:29 25 4
gpt4 key购买 nike

我正在制作一个网站,我需要包含一个关于女 Actor 梅丽尔斯特里普的页面。我想在她的奖项旁边贴一张她的照片。下图显示了我的页面现在的样子。我想知道如何使图片对齐到文本的右侧而不是下方?谢谢。

enter image description here

这是html代码:

 <div class="info">
<a id="awards"><h2>Awards: </h2></a>
<h3>Academy Awards</h3>
<h4>Won</h4>
<ol>
<li>Best Supporting Actress (Kramer vs. Kramer) - 1979</li>
<li>Best Actress (Sophie's Choice) - 1982</li>
<li>Best Actress (The Iron Lady) - 2011</li>
</ol>
<h4>Nominated</h4>
<ol>
<li>Best Supporting Actress (The Deer Hunter) - 1978</li>
<li>Best Actress (The French Lieutenant's Woman) - 1981</li>
<li>Best Actress (Silkwood) - 1983</li>
<li>Best Actress (Out of Africa) - 1985</li>
<li>Best Actress (Ironweed) - 1987</li>
<li>Best Actress (A Cry in the Dark) - 1988</li>
<li>Best Actress (Postcards from the Edge) - 1990</li>
<li>Best Actress (The Bridges of Madison County) 1995</li>
<li>Best Actress (One True Thing) - 1998</li>
<li>Best Actress (Music of the Heart) - 1999</li>
<li>Best Supporting Actress (Adaption) - 2002</li>
<li>Best Actress (The Devil Wears Prada) - 2006</li>
<li>Best Actress (Doubt) - 2008</li>
<li>Best Actress (Julie & Julia) - 2009</li>
<li>Best Actress (August: Osage County) - 2013</li>
<li>Best Supporting Actress (Into the Woods) - 2014</li>
</ol>
<div class="oscar">
<img src="oscar.jpg" alt="Picture of Meryl with an oscar" width="300"
height="400"/></a>
</div>
</div>

div:info 的 CSS: .info { 背景色:白色; 边框:凹槽; border-top-right-radius: 3em;

最佳答案

您尝试过使用表格吗?

<table>
<tr><td>1.Best Actor</td>
<td><img src="image.jpg"></td>
</tr>

等等....

它可能对你有帮助:)

关于html - 坚持使用CSS定位图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29392610/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com