2016-08-08 4 views

답변

0

당신은 다만 할 수 있습니다

.GridLayoutTextOnlyTweet { 
    background: red; 
} 

iframe에 있다는 문제가 안된다. 기본 스타일을 덮어 쓰려면 먼저 !important을 추가해야하지만 처음에는 시도하지 말아야합니다.

+0

https://dev.twitter.com/web/overview/css 중요와 함께 시도하고 작동하지 않았다. iFrame은 본질적으로 외국 콘텐츠이므로 순수한 CSS를 통해 조작 할 수는 없습니다. 트위 킹 할 수있는 자바 스크립트 훅 (또는 심지어 트위터 옵션 어딘가에)이 있는지는 확실하지 않지만 Google 검색 후에는 찾을 수 없습니다. – Dan382

+0

그것은 iframe에 관한 것이 아니라 도메인 간 보안에 관한 것입니다. – dval

-1

바로 이것이 어떻게 해결 되었습니까. 트위터 삽입 후 장소 :

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script> 
<script> 
var hideTwitterAttempts = 0; 
function hideTwitterBoxElements() { 
    setTimeout(function() { 
     if ($('[id*=twitter]').length) { 
     $('[id*=twitter]').each(function(){ 
      var ibody = $(this).contents().find('body'); 
      if (ibody.find('.grid-Widget').length) { 
      ibody.find('.GridLayoutTextOnlyTweet').css('background-color', '#1e73be'); 
      } 
      else { 
       $(this).hide(); 
      } 
     }); 
     } 
     hideTwitterAttempts++; 
     if (hideTwitterAttempts < 3) { 
      hideTwitterBoxElements(); 
     } 
    }, 1500); 
} 
// somewhere in your code after html page load 
hideTwitterBoxElements(); 
</script> 
+0

setTimeout을 사용하는 것이 완전히 예측할 수 없습니다. 사용자의 연결 속도가 느리고 2 초가 걸리면 어떻게해야합니까? – Alex

+0

동의하지 않는다면 이상적입니다. 네가 가진다면 더 나은 해결책을 찾을 수 있니? – Dan382

0

a.twitter-timeline { 
 
    /* Buttonish */ 
 
    display: inline-block; 
 
    padding: 6px 12px 6px 30px; 
 
    margin: 10px 0; 
 
    border: #ccc solid 1px; 
 
    border-radius: 3px; 
 
    background: #f8f8f8 url("") 8px 8px no-repeat; 
 
    background-size: 1em 1em; 
 

 
    /* Text */ 
 
    font: normal 12px/18px Helvetica, Arial, sans-serif; 
 
    color: #333; 
 
    white-space: nowrap; 
 
}

참조 :!