将 .field-item 图像浮动到内容类型的左侧而不是在 Drupal 中将其居中

Floating .field-item image to left of content type rather than centering it In Drupal

我对 Drupal 比较陌生,对 CSS 的了解一般,我正在尝试将特定内容类型上的图像浮动到内容的左侧,而不是将其置于页面中央自己排。该页面的目的是有一个项目列表(如目录),左侧有一个图像,右侧有各种描述性字段。

使用我在网上找到的内容,我能够在我的 CSS 上获得它,这几乎可以工作,但是在第一行正确位于图像右侧之后,下一行出现在图像下方。我希望所有这些都在图片的右边。

因为 Drupal 正在生成代码,所以我无法轻松更改 HTML(尽管在工作中这在理论上是可能的)但是 CSS 中的更改很简单

.field-item img {

  /* Shift "thumbail" images to the left */

  /* new code to shift image to the left */
  float: left;
  padding-right: 10px;

  /* -- old code to center image
  margin-left: auto;
  margin-right: auto;
  */
}

我的主题来源于danland。该页面本身可以在 http://blog.creatingorigami.com/content/eric%E2%80%99s-lotus

看到

任何线索将不胜感激!

为什么要更改 html 代码?这是废话。您可以使用完整样式 html 以使用 css 样式。

不知道我理解的对不对。此问题是 clearfix hack,您的页面包含 clearfixs。

最快 solution.Change css 属性 从两个值 inherit.In 系统 css 调用 system.base.css 清除。路径为 ..(root)/modules/system/.etc

之后将全部包含在右侧。

.clearfix:after {
content: ".";
display: block;
height: 0;
clear: inherit; /*changed property!*/
visibility: hidden;
}

舒服,但不干净解决方法是暴力重写属性 到根 css 样式。

.clearfix:after {
    clear: inherit !important;
    }