Css风格不起作用



这是我的工作站点-mysite我创建了一个页面,并使用以下代码将其调用到主页

<div class="hilight-hometext">
<?php if(is_front_page()) :
$home_page_post_id = 308;
$home_page_post = get_post( $home_page_post_id, ARRAY_A );
$content_home = $home_page_post['post_content'];
$content_title = $home_page_post['post_title'];
?><?php
echo $content_home;
endif; ?></div>

结果是

<div class="hilight-hometext">
<div id="hilightbox">
<div class="hilightbox-text">
<h2>At Salisbury we want everyone to understand their landscaping choices</h2>
Our latest landscaping innovation is our Outdoor Vision questionnaire. We’ll guide you     through a set of questions that will help you realize what you want out of your yard.
</div>
<!-- end tier 2 text -->
<div class="hilightbox-action">
<a class="myButton" href="resources/the-outdoor-vision-tool/">GET STARTED</a>
Your Outdoor Vision
</div>
</div></div>

我添加了如下样式

#hilightbox {
background: url(../img/action-bg.jpg);
width: 100%;
margin: 20px auto;
}
#hilightbox .hilightbox-text {
width: 75%;
float: left;
margin: 0;
}
#hilightbox .hilightbox-action {
width: 25%;
float: left;
padding: 15px 0;
}
.myButton {
background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #c9df23),         color-stop(1, #747728));
background: -moz-linear-gradient(center top, #c9df23 5%, #747728 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#c9df23', endColorstr='#747728');
background-color: #c9df23;
display: inline-block;
color: #ffffff;
font-family: Arial;
font-size: 20px;
font-weight: bold;
padding: 14px 14px;
text-decoration: none;
text-shadow: 1px 1px 0px #747728;
}

但是背景图像和样式没有显示出来。请帮忙!!感谢

我想如果你只添加这个:

#hilightbox {
  background: url(../img/action-bg.jpg);
  width: 100%;
  margin: 20px auto;
  overflow: hidden;
}

它会解决你的问题。当前您的容器div #hilightbox不知道子div的(.hilightbox-texthilightbox-actionheight&CCD_ 5,因为CCD_。

相关内容

  • 没有找到相关文章

最新更新