我已经创建了一个使用shadowbox打开div的代码,但我无法为该div设置CSS属性。这是我的代码。如何在SHADOWBOX中声明div的CSS属性?
<style>
.h2class {
font-family:'Century Gothic';
font-weight:lighter;
color:white;
padding-left:10px;
}
.DivClass1 {
display:none;
background-image:url(~/Images/Image1.jpg);
background-repeat:no-repeat;
background-size:cover;
}
</style>
<script>
$(document).ready(function() {
$(function() {
Shadowbox.init({
skipSetup: true
});
$('#Link1').click(function() {
var content = $('#Div1').html();
Shadowbox.open({
content: content,
player: 'html',
displayNav: false,
height: 500,
width:400
});
});
</script>
<div id="Div1" class="DivClass1">
<h2 class="h2class">Hello/h2>
</div>
<a id="Link1" href="#">Click Me</a>
我需要给背景图像和背景颜色Div1构成。请帮忙!!
我试过了。我尝试了所有声明CSS的方法(使用id,class,inline,external),但我发现没有改变。为什么? – Gogul 2014-09-04 14:27:59