Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/list/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 坚持使用css定位图像_Html_Css_Position_Css Position - Fatal编程技术网

Html 坚持使用css定位图像

Html 坚持使用css定位图像,html,css,position,css-position,Html,Css,Position,Css Position,我正在制作一个网站,我需要包括一个关于女演员梅丽尔·斯特里普的页面。我想在她的奖项旁边贴一张她的照片。下面的图片显示了我的页面现在的样子。我想知道如何使图片与文本右侧对齐,而不是与文本下方对齐?谢谢 这是html代码: <div class="info"> <a id="awards"><h2>Awards: </h2></a> <h3>Academy Awards</h3> <h4>Won<

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

这是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>

奖品:
奥斯卡奖
赢了
  • 最佳女配角(克莱默vs.克莱默)——1979年
  • 最佳女演员(苏菲的选择)-1982年
  • 2011年最佳女主角(铁娘子)
  • 提名的
  • 最佳女配角(猎鹿人)——1978年
  • 最佳女演员(法国中尉的女人)——1981年
  • 1983年最佳女演员(西尔伍德)
  • 最佳女主角(非洲以外)-1985年
  • 1987年最佳女演员(铁草)
  • 最佳女演员(黑暗中的哭泣)-1988年
  • 最佳女演员(来自边缘的明信片)-1990年
  • 1995年最佳女演员(麦迪逊郡之桥)
  • 最佳女演员(一件真实的事情)-1998年
  • 1999年最佳女主角(心灵音乐)
  • 最佳女配角(改编)-2002年
  • 最佳女演员(穿着普拉达的魔鬼)-2006
  • 最佳女演员(怀疑)——2008
  • 2009年最佳女演员(朱莉和朱莉娅)
  • 2013年最佳女演员(8月:奥萨奇县)
  • 2014年最佳女配角(走进树林)
  • 用于div:info的CSS: .info{ 背景色:白色; 边框:凹槽;
    边框右上角半径:3em;

    是否尝试使用表格

    <table>
    <tr><td>1.Best Actor</td>
    <td><img src="image.jpg"></td>
    </tr>
    
    
    1.最佳男主角
    
    等等


    它可能会帮助您:)

    您可以使用float属性来浮动它

    
    1.最佳女演员
    2.最佳女演员
    3.最佳女演员
    4.最佳女演员
    
    您必须在第二个“ol”中添加以下样式:

    宽度:自动; 浮动:左


    然后它就可以工作了。

    请发布你的代码好的,我已经提出了问题,尽管我粘贴的html代码只显示了信息。
    <div style="float: left;">
      1. Best Actress
      2. Best Actress
      3. Best Actress
      4. Best Actress
    </div>
    <div style="float: right;">
      <img src="link-to-image-file" />
    </div>