如何更改 DFP 文本 Link 广告素材样式,该样式从用户代理样式表强制显示为 Times New Roman?
How do I change DFP Text Link Creative style, which is forced to display as Times New Roman from user agent stylesheet?
我们在整个网站上使用 DFP 文字广告创意,但用户代理样式表强制它以 Times New Roman 字体显示(见附件)
从 iframe 中删除 link 并将其放入 DOM 对我们来说不是一个选项:
dfp 中的选项只允许您更改文本颜色,而不能更改字体系列。我们对样式的控制越多越好,但是有人对如何至少更改 link 的字体系列有任何建议吗?
<!DOCTYPE HTML>
<html lang="en-us">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Test text link</title>
<style type="text/css" media="screen">
body{
font-family: 'Helvetica', Arial, sans-serif;
}
</style>
<script type='text/javascript'>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
(function() {
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') +
'//www.googletagservices.com/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
</script>
<script type='text/javascript'>
googletag.cmd.push(function() {
googletag.defineSlot('[PATH/TO/SLOT]', [650, 16], '[DIV-GPT-ID]').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
</script>
<body>
Generic body content<br><br>
<!-- text-link -->
<div id='[DIV-GPT-ID]' style='width:650px; height:16px;'>
<script type='text/javascript'>
googletag.cmd.push(function() { googletag.display('[DIV-GPT-ID]'); });
</script>
</div>
</body>
</html>
对于访问这个的任何人,我能够通过添加来解决它:
googletag.pubads().enableSyncRendering();
所以 javascript 看起来像:
<script type='text/javascript'>
googletag.cmd.push(function() {
googletag.defineSlot('[PATH/TO/SLOT]', [650, 16], '[DIV-GPT-ID]').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.pubads().enableSyncRendering();
googletag.enableServices();
});
</script>
我们在整个网站上使用 DFP 文字广告创意,但用户代理样式表强制它以 Times New Roman 字体显示(见附件)
从 iframe 中删除 link 并将其放入 DOM 对我们来说不是一个选项:
dfp 中的选项只允许您更改文本颜色,而不能更改字体系列。我们对样式的控制越多越好,但是有人对如何至少更改 link 的字体系列有任何建议吗?
<!DOCTYPE HTML>
<html lang="en-us">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Test text link</title>
<style type="text/css" media="screen">
body{
font-family: 'Helvetica', Arial, sans-serif;
}
</style>
<script type='text/javascript'>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
(function() {
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') +
'//www.googletagservices.com/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
</script>
<script type='text/javascript'>
googletag.cmd.push(function() {
googletag.defineSlot('[PATH/TO/SLOT]', [650, 16], '[DIV-GPT-ID]').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
</script>
<body>
Generic body content<br><br>
<!-- text-link -->
<div id='[DIV-GPT-ID]' style='width:650px; height:16px;'>
<script type='text/javascript'>
googletag.cmd.push(function() { googletag.display('[DIV-GPT-ID]'); });
</script>
</div>
</body>
</html>
对于访问这个的任何人,我能够通过添加来解决它:
googletag.pubads().enableSyncRendering();
所以 javascript 看起来像:
<script type='text/javascript'>
googletag.cmd.push(function() {
googletag.defineSlot('[PATH/TO/SLOT]', [650, 16], '[DIV-GPT-ID]').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.pubads().enableSyncRendering();
googletag.enableServices();
});
</script>