구체적으로 그리드 레이아웃을 사용하는 다음 트위터 임베딩 방법 (https://dev.twitter.com/web/embedded-timelines)을 사용하면 배경색을 제어 할 수 있습니까? Twitter 임베드 타임 라인 배경색
맥락에서 문제
: http://bitly.com/2aFUuhjI 업데이트 사랑 스타일 클래스 "GridLayoutTextOnlyTweet"내 그러나 이것은 iframe이 안에 있습니다.
구체적으로 그리드 레이아웃을 사용하는 다음 트위터 임베딩 방법 (https://dev.twitter.com/web/embedded-timelines)을 사용하면 배경색을 제어 할 수 있습니까? Twitter 임베드 타임 라인 배경색
맥락에서 문제
: http://bitly.com/2aFUuhjI 업데이트 사랑 스타일 클래스 "GridLayoutTextOnlyTweet"내 그러나 이것은 iframe이 안에 있습니다.
당신은 다만 할 수 있습니다
.GridLayoutTextOnlyTweet {
background: red;
}
iframe에 있다는 문제가 안된다. 기본 스타일을 덮어 쓰려면 먼저 !important
을 추가해야하지만 처음에는 시도하지 말아야합니다.
바로 이것이 어떻게 해결 되었습니까. 트위터 삽입 후 장소 :
<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>
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;
}
참조 :!
https://dev.twitter.com/web/overview/css 중요와 함께 시도하고 작동하지 않았다. iFrame은 본질적으로 외국 콘텐츠이므로 순수한 CSS를 통해 조작 할 수는 없습니다. 트위 킹 할 수있는 자바 스크립트 훅 (또는 심지어 트위터 옵션 어딘가에)이 있는지는 확실하지 않지만 Google 검색 후에는 찾을 수 없습니다. – Dan382
그것은 iframe에 관한 것이 아니라 도메인 간 보안에 관한 것입니다. – dval