【发布时间】:2010-03-09 12:28:48
【问题描述】:
好的,我在 CSS 方面很有经验,但现在我不知所措。
我列出了我希望标题在 photoshop 中的样子:
alt text http://screensnapr.com/u/qz26q5.png
然而,我可以用 css 最接近它的是:
alt text http://screensnapr.com/u/s7xi7a.png
我需要黑色背景延伸到图像边缘并在标题右侧填充。
希望你能理解我的问题!谢谢。
这里是html:
<div class="glossary_image">
<img src="<?php echo $custom_fields['image'][0]; ?>" />
<div class="title">
<h2><?php the_title(); ?></h2>
</div>
</div>
和css:
.glossary_image {
position: relative;
height: 300px;
width: 300px;
margin-top:10px;
margin-bottom: 10px;
}
.glossary_image .title {
position: absolute;
bottom: 0;
left: 0;
padding: 10px;
}
.glossary_image .title h2 {
display: inline;
font-family:Arial, Helvetica, sans-serif;
font-size: 30px;
font-weight:bold;
line-height: 35px;
color: #fff;
text-transform:uppercase;
background: #000;
}
【问题讨论】:
-
请向我们展示您当前的 CSS 和 HTML。
标签: css css-selectors