당신이 원하는 내가 왜 이해가 안 돼요? 당신은 parent
에 background-image
도, 당신의 CSS에 당신이 background-attachment:scroll
을 설정 한 다음 background-attachment:fixed
와 함께 다음 줄에 덮어 CSS 또는 인라인 CSS로 쓸 수 있습니다. 그건 맞지 않아. 하나를 선택 :
내 유일한 생각 엔 당신이 background-image
child
이 무슨에 따라 parent
의 background-image
을 변경하려는 것입니다.
이 도움이된다면 알려 : 그래서 당신은
이 조각을 볼 같은 것을 할 수 있습니다. JQ없이
var bck = $(".section-bg").css("background-image")
$(".bet-section").css("background-image", bck);
.section-bg{
padding-top:35px;
background: transparent url('http://beerhold.it/579/300') no-repeat scroll 0px 0px ;
}
.bet-section {
background-repeat:no-repeat;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<section class="bet-section inner-section " style="">
\t <div class="section-bg"></div>
\t <div class="row">
\t <div class="col-md-5 col-md-offset-1 image-right-pad">
\t <img src="./assets/images/img-content/th-1.jpg">
\t
\t </div>
\t <div class="col-md-6 content">
\t
\t <h2><span style="display:block">Our</span> <span style="font-size: 54px; font-weight: bold; padding-top: 60px; color: rgb(96, 31, 76);">Story</span></h2>
<br>
<p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore </p>
\t </div>
\t </div>
\t
\t </section>
또는
는 이렇게 간단하게 할 수있다. 이것은 그것을하는 논리적 인 방법 일 것입니다.
.bet-section {
background: transparent url('http://beerhold.it/579/300') no-repeat scroll 0px 0px ;}
.section-bg{
padding-top:35px;
}
<section class="bet-section inner-section " style="">
\t <div class="section-bg"></div>
\t <div class="row">
\t <div class="col-md-5 col-md-offset-1 image-right-pad">
\t <img src="./assets/images/img-content/th-1.jpg">
\t
\t </div>
\t <div class="col-md-6 content">
\t
\t <h2><span style="display:block">Our</span> <span style="font-size: 54px; font-weight: bold; padding-top: 60px; color: rgb(96, 31, 76);">Story</span></h2>
<br>
<p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore </p>
\t </div>
\t </div>
\t
\t </section>
또는 당신은 다음과 같이 인라인 작성할 수
<section class="bet-section inner-section " style="background-image:url('image url')">
왜 당신이 아이를 어떻게해야합니까? 왜 부모님 께 맡길 수 없습니까? –
비록 내가 왜 CSS 또는 인라인 CSS에서 배경 이미지를 추가하는 대신 jQuery를 통해이 작업을 수행해야하는지 이해할 수는 없지만 아래 답변을 제공했습니다. 도움이되는지 알려주세요. –