无法使图像浮动到UL的右边

桑尼奥兹

我正在尝试使图像浮动到p和ul标签的右侧...但是各个列表项始终不清晰,并出现在图像底部之后。我尝试了许多不同的方法(在阅读了其他人对此问题的理解之后),但无法使其与我的示例一起使用。

任何建议,将不胜感激。

请参见下面的代码段:

* {
  padding: 0;
  margin: 0;
}
p {
  line-height: 140%;
  color: #B4B4B4;
  font-size: 14px;
  font-weight: normal;
}
ul {
  font-size: 14px;
  line-height: 140%;
  font-weight: normal;
  list-style-type: disc;
  display: block;
  float: left;
  text-align: left;
  padding-left: 15px;
  margin-left: 15px;
  margin-right: 10px;
}
#awards {
  float: left;
  margin: 10px 0px 60px 10px;
  padding: 15px 15px 15px 15px;
  width: 650px;
  display: block;
  text-align: left;
  background-color: #000;
  font-size: 14px;
  color: #fff;
  border: 2px solid #FBDDA0;
}
p.news {
  line-height: 110%;
  font-weight: normal;
  text-align: left;
  font-size: 14px;
  color: fff;
}
p.news a {
  color: #fff;
  text-decoration: none;
}
p.news a:hover {
  color: #C0C0C0;
  text-decoration: underline;
}
#awards ul {
  margin-top: 5px;
  line-height: 110%;
  font-weight: normal;
  text-align: left;
  font-size: 13px;
  color: #fff;
}
#awards ul li {
  margin-bottom: 7px;
}
<div id="awards">
  <a href="http://www.allanzavod.com/images/Allan_OAM-med-adj.jpg" target="_blank">
    <img src="http://www.allanzavod.com/images/Allan_OAM-med-adj.jpg" width="200" height="190" style="float: right; margin-left: 10px; margin-bottom: 10px;" border="0" title="Allan Zavod awarded OAM - click to read article" alt="Allan Zavod awarded OAM - click to read article"
    />
  </a>
  <div>
    <p class="news">The late Dr. Allan Zavod received the <span style="color: #FBDDA0; font-weight: normal">Medal of the Order of Australia (OAM)</span> on January 26 2017, for service to the performing arts as a musician and composer. Here are some of his outstanding
      acheivements:</p>
    <ul style="padding-top: 7px;">
      <li>1st Australian to attend Berklee College of Music, Boston, on Duke Ellington's recommendation, 1970.</li>
      <li>1st Jazz Fusion Concerto on Australia Day for the Bicentenial at the Opera House performed by Australian Youth Orchestra in 1988.</li>
      <li>Won the Asia-Pacific Broadcasting Union (ABU) Song Contest in Kuala Lumpur (as composer), taking a very young singer Kate Ceberano on her first international performance, 1987.</li>
      <li>Awarded Doctor of Music by Melbourne University in recognition of his international achievements as a composer of Classical Jazz Fusion and for his substantial, original and distinguised contribution to music knowledge, 2009.</li>
      <li>Environmental Symphony, performed initially at The Banksia Environmental Awards in 2010. Later performed in full by the Melbourne Symphony Orchestra at Hamer Hall in 2015 - all proceeds (over $100,000.00) going to the Royal Melbourne Hospital for
        GBM Brain Cancer Research.</li>
    </ul>
  </div>

</div>
<!-- end awards -->

迈克尔·科克

这就是浮动的工作方式。文本将环绕在浮动元素的下方。

由于图像具有较宽的宽度,因此可以对与图像宽度匹配的文本包装器应用边距。

* {
  padding: 0;
  margin: 0;
}
p {
  line-height: 140%;
  color: #B4B4B4;
  font-size: 14px;
}
ul {
  font-size: 14px;
  line-height: 140%;
  list-style-type: disc;
  padding-left: 15px;
  margin-left: 15px;
  margin-right: 10px;
}
#awards {
  margin: 10px 0px 60px 10px;
  padding: 15px;
  width: 650px;
  background-color: #000;
  font-size: 14px;
  color: #fff;
  border: 2px solid #FBDDA0;
}
p.news {
  line-height: 110%;
  font-weight: normal;
  font-size: 14px;
  color: fff;
}
p.news a {
  color: #fff;
  text-decoration: none;
}
p.news a:hover {
  color: #C0C0C0;
  text-decoration: underline;
}
#awards ul {
  margin-top: 5px;
  line-height: 110%;
  font-weight: normal;
  text-align: left;
  font-size: 13px;
  color: #fff;
}
#awards ul li {
  margin-bottom: 7px;
}

#awards > div {
  margin-right: 200px;
}
<div id="awards">
  <a href="http://www.allanzavod.com/images/Allan_OAM-med-adj.jpg" target="_blank">
    <img src="http://www.allanzavod.com/images/Allan_OAM-med-adj.jpg" width="200" height="190" style="float: right; margin-left: 10px; margin-bottom: 10px;" border="0" title="Allan Zavod awarded OAM - click to read article" alt="Allan Zavod awarded OAM - click to read article"
    />
  </a>
  <div>
    <p class="news">The late Dr. Allan Zavod received the <span style="color: #FBDDA0; font-weight: normal">Medal of the Order of Australia (OAM)</span> on January 26 2017, for service to the performing arts as a musician and composer. Here are some of his outstanding
      acheivements:
    </p>
    <ul style="padding-top: 7px;">
      <li>1st Australian to attend Berklee College of Music, Boston, on Duke Ellington's recommendation, 1970.</li>
      <li>1st Jazz Fusion Concerto on Australia Day for the Bicentenial at the Opera House performed by Australian Youth Orchestra in 1988.</li>
      <li>Won the Asia-Pacific Broadcasting Union (ABU) Song Contest in Kuala Lumpur (as composer), taking a very young singer Kate Ceberano on her first international performance, 1987.</li>
      <li>Awarded Doctor of Music by Melbourne University in recognition of his international achievements as a composer of Classical Jazz Fusion and for his substantial, original and distinguised contribution to music knowledge, 2009.</li>
      <li>Environmental Symphony, performed initially at The Banksia Environmental Awards in 2010. Later performed in full by the Melbourne Symphony Orchestra at Hamer Hall in 2015 - all proceeds (over $100,000.00) going to the Royal Melbourne Hospital for
        GBM Brain Cancer Research.</li>
    </ul>
  </div>

</div>

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

jQuery的。使菜单浮动到父级的右边?

来自分类Dev

将div外部的段落链接浮动到右边之后

来自分类Dev

为什么我的水平菜单没有浮动到右边?

来自分类Dev

如何在不指定固定宽度的情况下将无序列表(ul)浮动到图像的右侧

来自分类Dev

将Tiff图像浮动到numpy数组

来自分类Dev

使图像浮动到HTML列表的左侧

来自分类Dev

在浮动到右侧的图像周围对齐文本

来自分类Dev

CSS避免将ul列表项浮动到框

来自分类Dev

无法浮动:在水平ul上左移

来自分类Dev

浮动DIV包含图像到文本右边,容器必须是可流动的

来自分类Dev

无法在图像旁边向右浮动文本

来自分类Dev

无法使图片浮动到顶部。需要页面旁边的表单

来自分类Dev

如果没有足够的空间,垂直对齐的图像会向左浮动,而右边的文字会自动换行?

来自分类Dev

我试图以 33% 的宽度将三个图像并排浮动。为什么右边有多余的空间?

来自分类Dev

QT:浮动到QString

来自分类Dev

链接浮动到左边?

来自分类Dev

从右边的css裁剪图像

来自分类Dev

ul的浮动部分

来自分类Dev

在div右边浮动一些文本

来自分类Dev

将所有锚点移动到浮动图像顶部的 Word VBA 宏

来自分类Dev

无法摆脱右边距

来自分类Dev

浮动到双重误解???g ++

来自分类Dev

目标C浮动到NSString

来自分类Dev

div不浮动到中心

来自分类Dev

将按钮浮动到右侧

来自分类Dev

Symfony 3 VichUploaderBundle无法将图像移动到正确的目录

来自分类Dev

无法与 Internet Explorer 的 ul 元素内的中心图像对齐

来自分类Dev

在图像上浮动Div

来自分类Dev

Tinymce如何浮动图像?