在 Drupal 7 中向图像字段添加类 [英] Add Class to Image Field in Drupal 7

查看:20
本文介绍了在 Drupal 7 中向图像字段添加类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在内容类型基本页面"中添加了一个图像字段,并使用管理显示"选项将其显示在页面顶部.但是,图像上没有样式,我一生都无法弄清楚如何向图像添加类以便添加样式.

I have added an image field to content type "Basic Page" and using the "Manage Displays" option have it displayed at the top of the page. However there is no styling on the image and I can't for the life of me figure out how I add a class to the image so that I can add styles.

推荐答案

如果您使用的是 CCK,几乎可以肯定有一个类已经与图像相关联(或者至少是包装它的 div 上的一个类).CCK 包装了类中的几乎所有内容.尝试右键单击图像并单击检查元素以仔细检查.

If you're using CCK there's almost certainly a class already associated with the image (or at least a class on a div that wraps it). CCK wraps just about everything in a class. Try right clicking the image and clicking on Inspect Element to double check.

如果你真的需要添加一个类,你可以使用 Theme Developer 模块来查找要覆盖什么主题函数或模板文件.查看主题开发者截屏视频了解更多详情.

If you really need to add a class though, you can use the Theme Developer module to find out what theme function or template file to override. Check out the Theme Developer screencast for more details.

这篇关于在 Drupal 7 中向图像字段添加类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆