问题描述
我已经向内容类型基本页面添加了图像字段,并使用管理显示选项将其显示在页面的顶部。然而,图像上没有样式,我无法为我的生活找出我如何添加一个类到图像,以便我可以添加样式。
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.
如果您真的需要添加类,可以使用,找出要覆盖的主题功能或模板文件。查看。
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中的图像字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!