나는 CSS로 스타일링 된 네 개의 상자가 있고 오른쪽에 마가 니가 나란히 서있다. 마지막 상자에서 오른쪽 여백을 제거하는 클래스를 추가하여 모두 같은 줄에 앉아 있습니다. 여기 jquery last addclass
여기<head>
<script type="text/javascript">
$(document).ready(function(){
$('div.home-features:last').addClass('last');
});
</script>
에있는 JQuery와 인 코드가
를 생성<div class="content-box2-top"><!-- no content--></div>
<div class="content-box2-center">
<div class="home-features">
<h2>Services</h2>
<span class="content">
One point of contact for your international operations eliminating the need for multiple relationships.<br />
</span>
<a class="read" href="/getdoc/762a1cb8-2492-4844-8401-5037e7c30afc/Services">Read More</a>
</div>
<div class="home-features">
<h2>Process</h2>
<span class="content">
Global access to your accounts, 24 hours a day through our secure online accounting portal.
</span>
<a class="read" href="/getdoc/6c7b45da-4e86-44fa-9a15-6d1298576b8a/Process">Read More</a>
</div>
<div class="home-features">
<h2>Benefits</h2>
<span class="content">
Alleviating the burden of recruiting and managing in-house accounting teams.
</span>
<a class="read" href="/getdoc/592b78e1-f17f-498e-b3bb-f159e4c2d348/Benefits">Read More</a>
</div>
<div class="home-features">
<h2>Reach</h2>
<span class="content">
Drawing on the local knowledge and expertise of our partner firms around the world.
</span>
<a class="read" href="/getdoc/9e82f2b8-7aaa-417d-9c23-a235c4ff26fd/Reach">Read More</a>
</div>
</div>
<div class="content-box2-bottom"><!-- no conetnt --></div>
문제는 그 "마지막"을 추가 지연은 페이지가로드가있을 때 클래스에서 마지막 요소로. 그래서 그것은 다른 세 밑에 나타나고, 그 다음 장소에 핑 소리가 난다!
어떻게하면 막을 수 있으며 인라인으로 표시됩니까?
JavaScript 코드를 이동해도 큰 차이는 없습니다. 그것이 문서의 전체 요점입니다 .ready –
content-box2-bottom 다음에 엄청난 양의 코드가있을 것입니다. OP가 (마지막으로 바람직한 방법 인) ASP를 사용하여'last' 클래스를 추가 할 수 없다면 시도해 볼 가치가 있습니다. –