我有IPSuite 4.1.11,它在边栏上有“类似内容”块。 即时通讯使用Chameleon主题,它可以发现here如何在PHP代码中更改文本样式和颜色
我想使用CSS来设计它,但我卡住了 - 我不能改变作者名称的风格。我的意思是作者的名字。 我接受了样式名称和其他文本 - 但我只想着色作者姓名。
这里是块的图片:
这里是我想改变:
现在这里是,作者姓名的相关代码:
{{endif}}
<a href="{$topic->url()->setQueryString('do', 'getNewComment')}" title='{lang="view_this_topic" sprintf="$topic->title"}' class='ipsDataItem_title ipsType_break'>{wordbreak="$topic->title"}</a>
<br>
<p class='ipsType_reset ipsType_medium ipsType_blendLinks'>
<span>{lang="byline_nodate" htmlsprintf="$topic->author()->link()"}</span>
<span class='ipsType_light'>{lang="topic_started_date" htmlsprintf="\IPS\DateTime::ts($topic->mapped('date'))->html()"}</span>
</p>
</div>
</li>
{{endforeach}}
这里是全 “TopicFeed块” 代码:
{{if !empty($topics) }}
<h3 class='ipsWidget_title ipsType_reset'>{$title}</h3>
{{if $orientation == 'vertical'}}
<div class='ipsPad_half ipsWidget_inner'>
<ul class='ipsDataList ipsDataList_reducedSpacing'>
{{foreach $topics as $topic}}
<li class='ipsDataItem{{if $topic->unread()}} ipsDataItem_unread{{endif}}{{if $topic->hidden()}} ipsModerated{{endif}}'>
<div class='ipsDataItem_icon ipsPos_top'>
{template="userPhoto" group="global" app="core" params="$topic->author(), 'tiny'"}
</div>
<div class='ipsDataItem_main'>
<div class="ipsCommentCount ipsPos_right {{if ($topic->posts - 1) === 0}}ipsFaded{{endif}}" data-ipsTooltip title='{lang="replies_number" pluralize="$topic->posts - 1"}'>{expression="$topic->posts - 1"}</div>
{{if $topic->mapped('featured') || $topic->hidden() === -1 || $topic->hidden() === 1}}
<span>
{{if $topic->hidden() === -1}}
<span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_warning" data-ipsTooltip title='{$topic->hiddenBlurb()}'><i class='fa fa-eye-slash'></i></span>
{{elseif $topic->hidden() === 1}}
<span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_warning" data-ipsTooltip title='{lang="pending_approval"}'><i class='fa fa-warning'></i></span>
{{endif}}
{{if $topic->mapped('featured')}}
<span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_positive" data-ipsTooltip title='{lang="featured"}'><i class='fa fa-star'></i></span>
{{endif}}
</span>
{{endif}}
<a href="{$topic->url()->setQueryString('do', 'getNewComment')}" title='{lang="view_this_topic" sprintf="$topic->title"}' class='ipsDataItem_title ipsType_break'>{wordbreak="$topic->title"}</a>
<br>
<p class='ipsType_reset ipsType_medium ipsType_blendLinks'>
<span>{lang="byline_nodate" htmlsprintf="$topic->author()->link()"}</span>
<span class='ipsType_light'>{lang="topic_started_date" htmlsprintf="\IPS\DateTime::ts($topic->mapped('date'))->html()"}</span>
</p>
</div>
</li>
{{endforeach}}
</ul>
</div>
{{else}}
<div class='ipsWidget_inner'>
<ul class='ipsDataList'>
{{foreach $topics as $topic}}
{template="row" group="global" app="forums" location="front" params="NULL, NULL, $topic, FALSE"}
{{endforeach}}
</ul>
</div>
{{endif}}
{{endif}}
我插入CSS项到ipsuite,上面写着:
.ipstlight_auther {font-weight: bold; color:red;}
和变更情况:从
<span>{lang="byline_nodate" htmlsprintf="$topic->author()->link()"}</span>
到:
<span class='ipstlight_auther'>{lang="byline_nodate" htmlsprintf="$topic->author()->link()"}</span>
或邮寄至:
<span>{lang="byline_nodate" <span class='ipstlight_auther'>htmlsprintf="$topic->author()->link()"}</span></span>
但没有成功。
我错过了什么?
编辑:
当我尝试使用 “spencerlarry” 第一个CSS的答案我得到这个:
,当我加入重要;每个值后,我得到了:
为什么它的作用那样?
药物工作。在底部的主要问题中查看上面的细节(在编辑下)。 – StackBuck
现在可能会有效。我的第一个答案选择了两个'span'元素。这种方式只选择第一个。 –