请教个跟css有关的问题 v2的前端朋友们过来帮下忙

2012-07-18 23:22:23 +08:00
 acpp
<div class="main">
<div class="deal-buy">
<div class="deal-price-tag"></div>
<!--{if ($team['state']=='soldout')}-->
<p class="deal-price"><strong>{$currency}${moneyit($team['team_price'])}</strong><span class="deal-price-soldout"></span></p>
<!--{elseif $team['close_time']}-->
<p class="deal-price"><strong>{$currency}${moneyit($team['team_price'])}</strong><span class="deal-price-expire"></span></p>
<!--{else}-->
<p class="deal-price"><strong>{$currency}${moneyit($team['team_price'])}</strong><span><a href="${$team['begin_time']<time()?'/team/buy.php?id='.$team['id'] : 'javascript: alert(\'秒杀还未开始...\')'}"><img src="/static/css/i/button-deal-buy_seconds.gif" /></a></span></p>
<!--{/if}-->
</div>

最后一个段落属性,我单独复制了一段css出来 改成了这样

<p class="deal-pricexx"><strong>{$currency}${moneyit($team['team_price'])}</strong><span><a href="${$team['begin_time']<time()?'/team/buy.php?id='.$team['id'] : 'javascript: alert(\'秒杀还未开始...\')'}"><img src="/static/css/i/button-deal-buy_seconds.gif" /></a></span></p>

#deal-intro .deal-pricexx span a { display:block; width:120px; height:53px; line-height:53px; margin-top:-13px; outline:0; margin-left: 0px; padding-left: -10px; }

我想问下,为什么单独弄了一下,没有达到想要的效果呢,是因为这个p属性受div的限制了么?
2023 次点击
所在节点    问与答
2 条回复
YuHong
2012-07-19 01:34:36 +08:00
p.deal-pricexx 是否是#deal-intro 的子节点?
不太清楚你的问题出在哪儿。可以使用浏览器的查看元素看看计算出来的样式再分析一下呗
liuzhoou
2012-07-19 11:21:13 +08:00
看到一推夹杂混合的片段,头晕。
建议用下 http://dabblet.com/ 测试你要的效果吧

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/42776

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX