将内联CSS移动到外部样式表
我正在修改一个tumblr布局,其中包含内联css代码。我计划用tumblr创建一个时间敏感的css开关,使用一点javascript代码在白天和晚上之间切换主题。这需要有一个外部样式表,以便脚本可以在两个样式表之间切换 我将内联代码复制到一个外部css文件并上传了它。然后我做了一个css链接引用文件,但它似乎不工作 我刚才说的将内联CSS移动到外部样式表,css,inline-code,Css,Inline Code,我正在修改一个tumblr布局,其中包含内联css代码。我计划用tumblr创建一个时间敏感的css开关,使用一点javascript代码在白天和晚上之间切换主题。这需要有一个外部样式表,以便脚本可以在两个样式表之间切换 我将内联代码复制到一个外部css文件并上传了它。然后我做了一个css链接引用文件,但它似乎不工作 我刚才说的 <LINK REL=StyleSheet HREF="http://itsnotch.com/tumblr/files/gurucss.css" TYPE="te
<LINK REL=StyleSheet HREF="http://itsnotch.com/tumblr/files/gurucss.css" TYPE="text/css">
此外,还有字体、标题、日期等的元数据。。这可能是链接引用不起作用的原因吗?如果是这样,我可以在css中使用元数据吗
下面是布局的所有代码
{block:Description}{/block:Description}
<!-- DEFAULT COLORS -->
<meta name="color:Background" content="#d7a769"/>
<meta name="color:Title" content="#444"/>
<meta name="color:Description" content="#666"/>
<meta name="color:Post Title" content="#c00"/>
<meta name="color:Text" content="#444"/>
<meta name="color:Inline Link" content="#c00"/>
<meta name="color:Quote" content="#666"/>
<meta name="color:Quote Source" content="#444"/>
<meta name="color:Link Post" content="#c00"/>
<meta name="color:Conversation Background" content="#f8f8f8"/>
<meta name="color:Conversation Border" content="#ddd"/>
<meta name="color:Conversation Text" content="#444"/>
<meta name="color:Conversation Label" content="#111"/>
<meta name="color:Photo Border" content="#eee"/>
<meta name="color:Date" content="#fff"/>
<meta name="color:Date Background" content="#ccc"/>
<!-- END DEFAULT COLORS -->
<!-- DEFAULT SETTINGS -->
<meta name="image:Background" content="http://assets.tumblr.com/images/x.gif" />
<meta name="font:Title" content="Arial" />
<meta name="font:Body" content="Lucida Sans" />
<meta name="text:Disqus Shortname" content="" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>{block:SearchPage}Search results for "{SearchQuery}" - {/block:SearchPage}{block:PostSummary}{PostSummary} - {/block:PostSummary}{Title}</title>
<link rel="icon" href="{Favicon}"/>
<link rel="alternate" type="application/rss+xml" title="RSS" href="{RSS}"/>
<meta name="viewport" content="width=775"/> <!-- iPhone -->
<style type="text/css">
body {
margin: 0px;
background-image: url('http://itsnotch.com/tumblr/images/nighttime_bg.jpg');
background-repeat: repeat-x;
background-attachment: fixed;
background-position: top center;
background-color:#b68e59;
font-family: {font:Body};
}
#content {
width: 850px;
margin: auto;
margin-top: -44px;
padding: 15px;
background-color: {color:Content Background};
position: relative;
}
a {
color: {color:Inline Link};
}
h1 {
padding: 30px 0px 50px 0px;
margin: 0px;
text-align: center;
font: Bold 55px {font:Title};
letter-spacing: -2px;
line-height: 50px;
}
h1 a {
color: {color:Title};
text-decoration: none;
}
#description {
position: absolute;
left: -189px;
top: 150px;
}
#description div {
font: normal 18px {font:Body};
line-height: 20px;
width: 150px;
color: {color:Description};
}
#description div#search {
text-align: left;
}
#description div a {
color: {color:Description};
}
#description #nav_container {
font-size: 13px;
font-weight: bold;
}
#description #nav_container .dim {
filter: alpha(opacity=50);
-moz-opacity: 0.5;
opacity: 0.5;
}
#searchresultcount {
margin: 0 0 30px;
text-align: center;
}
.post {
position: relative;
margin-bottom: 40px;
}
.post div.labels {
position: absolute;
right: 435px;
text-align: right;
width: 150px;
}
.post div.date {
background-color: {color:Date Background};
white-space: nowrap;
font: Normal 20px {font:Body};
letter-spacing: -1px;
color: {color:Date};
display: inline;
padding: 3px 5px 0px 5px;
line-height: 20px;
}
.post div.date a {
color: {color:Date};
text-decoration: none;
}
.post img {
max-width: 100%;
}
.post h2 {
font-size: 18px;
font-weight: Bold;
color: {color:Post Title};
letter-spacing: -1px;
margin: 0px 0px 10px 0px;
}
.post h2 a {
color: {color:Post Title};
text-decoration: none;
}
/* Regular Post */
.post .regular {
font-size: 12px;
color: {color:Text};
line-height: 17px;
}
.post .regular blockquote {
font-style: italic;
}
/* Photo Post */
.post .photo img {
border: solid 10px {color:Photo Border};
}
.post .photo div.caption {
font-size: 11px;
color: {color:Text};
margin-top: 5px;
}
.post .photo div.caption a {
color: {color:Text};
}
/* Quote Post */
.post .quote span.quote {
font: Bold 28px {font:Body};
letter-spacing: -1px;
color: {color:Quote};
}
.post .quote span.quote a {
color: {color:Quote};
}
.post .quote span.quote big.quote {
font: Bold 60px Georgia, serif;
line-height: 8px;
vertical-align: -20px;
}
.post .quote span.source {
font-size: 16px;
font-weight: Bold;
color: {color:Quote Source};
letter-spacing: -1px;
}
.post .quote span.source a {
color: {color:Quote Source};
}
/* Link Post */
.post .link a.link {
font: Bold 20px {font:Body};
letter-spacing: -1px;
color: {color:Link Post};
}
.post .link span.description {
font-size: 13px;
font-weight: normal;
letter-spacing: -1px;
}
/* Conversation Post */
.post .conversation ul {
background-color: {color:Conversation Background};
list-style-type: none;
margin: 0px;
padding: 0px;
border-left: solid 5px {color:Conversation Border};
}
.post .conversation ul li {
border-bottom: solid 1px {color:Conversation Border};
font-size: 12px;
padding: 4px 0px 4px 8px;
color: {color:Conversation Text};
}
.post .conversation ul li span.label {
font-weight: bold;
color: {color:Conversation Label};
}
/* Audio Post */
.post .audio div.caption {
font-size: 11px;
color: {color:Text};
margin-top: 5px;
}
.post .audio div.caption a {
color: {color:Text};
}
/* Video Post */
.post .video {
width: 400px;
margin: auto;
}
.post .video div.caption {
font-size: 11px;
color: {color:Text};
margin-top: 5px;
}
.post div.video div.caption a {
color: {color:Text};
}
/* Footer */
#footer {
margin: 40px 0px 30px 0px;
text-align: center;
font-size: 12px;
}
#footer a {
text-decoration: none;
color: {color:Text};
}
#footer a:hover {
text-decoration: underline;
}
.query { font-weight: bold; }
{CustomCSS}
</style>
<!--[if lt IE 7]>
<style type="text/css">
.post div.labels {
right: 450px;
}
</style>
<![endif]-->
</head>
<body>
<div id="content">
<h1><a href="/"><img src="http://itsnotch.com/tumblr/images/NotchTheGuru_Banner.jpg" border "0" /></a></h1>
<div id="description">
<div>
<div id="search">
<form action="/search" method="get">
<input type="text" name="q" value="{SearchQuery}"/>
<input type="submit" value="Search"/>
</form>
</div>
{Description}
<p id="nav_container">
<a href="/archive" id="archive_link">Archive</a>
<span class="dim">/</span>
<a href="{RSS}">RSS</a>
</p>
</div>
</div>
{block:SearchPage}
<div id="searchresultcount">
<p>Your search for <span class="query">{SearchQuery}</span> returned {SearchResultCount} result(s).</p>
</div>
{/block:SearchPage}
{block:Posts}
<div class="post">
<div class="labels">
{block:NewDayDate}
<div class="date"><a href="{Permalink}">{Month} {DayOfMonth}</a></div>
{/block:NewDayDate}
{block:SameDayDate}
<div class="date"><a href="{Permalink}">+</a></div>
{/block:SameDayDate}
</div>
{block:Regular}
<div class="regular">
{block:Title}<h2><a href="{Permalink}">{Title}</a></h2>{/block:Title}
{Body}
</div>
{/block:Regular}
{block:Photo}
<div class="photo">
{LinkOpenTag}<img src="{PhotoURL-400}" alt="{PhotoAlt}"/>{LinkCloseTag}
{block:Caption}
<div class="caption">{Caption}</div>
{/block:Caption}
</div>
{/block:Photo}
{block:Quote}
<div class="quote">
<span class="quote">
<big class="quote">“</big> {Quote}
</span>
{block:Source}<span class="source">{Source}</span>{/block:Source}
</div>
{/block:Quote}
{block:Link}
<div class="link">
<a href="{URL}" class="link" {Target}>{Name}</a>
{block:Description}
<span class="description">{Description}</span>
{/block:Description}
</div>
{/block:Link}
{block:Conversation}
<div class="conversation">
{block:Title}<h2><a href="{Permalink}">{Title}</a></h2>{/block:Title}
<ul>
{block:Lines}
<li>
{block:Label}<span class="label">{Label}</span>{/block:Label}
{Line}
</li>
{/block:Lines}
</ul>
</div>
{/block:Conversation}
{block:Audio}
<div class="audio">
{AudioPlayerGrey}
{block:Caption}
<div class="caption">{Caption}</div>
{/block:Caption}
</div>
{/block:Audio}
{block:Video}
<div class="video">
{Video-400}
{block:Caption}
<div class="caption">{Caption}</div>
{/block:Caption}
</div>
{/block:Video}
</div>
{block:IfDisqusShortname}
{block:Permalink}
<div id="disqus_thread"></div>
<script type="text/javascript" src="http://disqus.com/forums/{text:Disqus Shortname}/embed.js"></script>
<noscript><a href="http://{text:Disqus Shortname}.disqus.com/?url=ref">View the discussion thread.</a></noscript>
<div style="text-align: right; margin-top: 5px">
<a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>
</div>
{/block:Permalink}
{/block:IfDisqusShortname}
{/block:Posts}
<div id="footer">
{block:PreviousPage}
<a href="{PreviousPage}">« Previous</a>
{/block:PreviousPage}
{block:NextPage}
<a href="{NextPage}">Next »</a>
{/block:NextPage}
</div>
</div>
{block:IfDisqusShortname}
<script type="text/javascript">
//<![CDATA[
(function() {
var links = document.getElementsByTagName('a');
var query = '?';
for(var i = 0; i < links.length; i++) {
if(links[i].href.indexOf('#disqus_thread') >= 0) {
query += 'url' + i + '=' + encodeURIComponent(links[i].href) + '&';
}
}
document.write('<script charset="utf-8" type="text/javascript" src="http://disqus.com/forums/{text:Disqus Shortname}/get_num_replies.js' + query + '"></' + 'script>');
})();
//]]>
</script>
{/block:IfDisqusShortname}
</body>
{block:SearchPage}{SearchQuery}-{/block:SearchPage}{block:postsuminary}{postsuminary}-{/block:postsuminary}{Title}
身体{
边际:0px;
背景图像:url('http://itsnotch.com/tumblr/images/nighttime_bg.jpg');
背景重复:重复-x;
背景附件:固定;
背景位置:上中;
背景色:#b68e59;
字体系列:{font:Body};
}
#内容{
宽度:850px;
保证金:自动;
边缘顶部:-44px;
填充:15px;
背景色:{color:Content-background};
位置:相对位置;
}
a{
颜色:{color:Inline Link};
}
h1{
填充:30px 0px 50px 0px;
边际:0px;
文本对齐:居中;
字体:粗体55px{font:Title};
字母间距:-2px;
线高:50px;
}
H1A{
颜色:{color:Title};
文字装饰:无;
}
#描述{
位置:绝对位置;
左:-189px;
顶部:150px;
}
#描述组{
字体:普通18px{font:Body};
线高:20px;
宽度:150px;
颜色:{color:Description};
}
#描述分区#搜索{
文本对齐:左对齐;
}
#说明a组{
颜色:{color:Description};
}
#说明#导航集装箱{
字体大小:13px;
字体大小:粗体;
}
#说明#导航单元容器。尺寸{
过滤器:α(不透明度=50);
-moz不透明度:0.5;
不透明度:0.5;
}
#searchresultcount{
利润率:0.30px;
文本对齐:居中;
}
.邮政{
位置:相对位置;
边缘底部:40px;
}
.邮政部门标签{
位置:绝对位置;
右:435px;
文本对齐:右对齐;
宽度:150px;
}
.邮政部门日期{
背景色:{color:Date background};
空白:nowrap;
字体:普通20px{font:Body};
字母间距:-1px;
颜色:{color:Date};
显示:内联;
填充:3px 5px 0px 5px;
线高:20px;
}
.邮政部门日期a{
颜色:{color:Date};
文字装饰:无;
}
.后img{
最大宽度:100%;
}
.后h2{
字号:18px;
字体大小:粗体;
颜色:{color:Post Title};
字母间距:-1px;
保证金:0px 0px 10px 0px;
}
.后h2 a{
颜色:{color:Post Title};
文字装饰:无;
}
/*正规职务*/
.邮递{
字体大小:12px;
颜色:{color:Text};
线高:17px;
}
.post.regular blockquote{
字体:斜体;
}
/*照片贴*/
.post.photo img{
边框:实心10px{颜色:照片边框};
}
.邮递照片组标题{
字体大小:11px;
颜色:{color:Text};
边缘顶部:5px;
}
.邮递照片组标题a{
颜色:{color:Text};
}
/*报价单*/
.post.quote span.quote{
字体:粗体28px{font:Body};
字母间距:-1px;
颜色:{color:Quote};
}
.post.quote span.quote a{
颜色:{color:Quote};
}
.post.quote span.quote big.quote{
字体:粗体60px格鲁吉亚,衬线;
线高:8px;
垂直对齐:-20px;
}
.post.quote span.source{
字体大小:16px;
字体大小:粗体;
颜色:{color:Quote Source};
字母间距:-1px;
}
.post.quote span.source a{
颜色:{color:Quote Source};
}
/*接线柱*/
链接{
字体:粗体20px{font:Body};
字母间距:-1px;
颜色:{color:linkp
<p style="color:red;">hello world</p>
p { color:blue; }
p { color:blue!important; }
<SCRIPT LANGUAGE="JavaScript">
Begin function getCSS()
{
datetoday = new Date();
timenow=datetoday.getTime();
datetoday.setTime(timenow);
thehour = datetoday.getHours();
if (thehour > 20)
display = "http://itsnotch.com/tumblr/files/nighttime.css";
else if (thehour > 7)
display = "http://itsnotch.com/tumblr/files/daytime.css";
else
display = "http://itsnotch.com/tumblr/files/nighttime.css";
var css = '';
document.write(css);//
}
</script>
<script language="javascript">getCSS();</script>
{block:SearchPage}{/block:SearchPage}
body {
margin: 0px;
background-image: url('http://itsnotch.com/tumblr/images/nighttime_bg.jpg');
background-repeat: repeat-x;
background-attachment: fixed;
background-position: top center;
background-color:#b68e59;
font-family: Lucida Sans;
}
#content {
width:850px;
margin: auto;
margin-top: -44px;
padding: 15px;
background-color: #d7a769;
position: relative;
}
a {
color:#c00;
}
h1 {
padding: 30px 0px 50px 0px;
margin: 0px;
text-align: center;
font: Bold 55px Arial;
letter-spacing: -2px;
line-height: 50px;
}
h1 a {
color: #444;
text-decoration: none;
}
#description {
position: absolute;
left:-189px;
top: 150px;
}
#description div {
font: normal 18px Lucida Sans;
line-height: 20px;
width:150px;
color:#666;
}
#description div#search {
text-align: left;
}
#description div a {
color: #666;
}
#description #nav_container {
font-size: 13px;
font-weight: bold;
}
#description #nav_container .dim {
filter: alpha(opacity=50);
-moz-opacity: 0.5;
opacity: 0.5;
}
#searchresultcount {
margin: 0 0 30px;
text-align: center;
}
.post {
position: relative;
margin-bottom:40px;
}
.post div.labels {
position: absolute;
right:435px;
text-align: right;
width:150px;
}
.post div.date {
background-color: #ccc;
white-space: nowrap;
font: Normal 20px Lucida Sans;
letter-spacing: -1px;
color:#fff;
display: inline;
padding: 3px 5px 0px 5px;
line-height: 20px;
}
.post div.date a {
color:#fff;
text-decoration: none;
}
.post img {
max-width: 100%;
}
.post h2 {
font-size:18px;
font-weight: Bold;
color:#c00;
letter-spacing: -1px;
margin: 0px 0px 10px 0px;
}
.post h2 a {
color:#c00;
text-decoration: none;
}
/* Regular Post */
.post .regular {
font-size:12px;
color:#444;
line-height: 17px;
}
.post .regular blockquote {
font-style: italic;
}
/* Photo Post */
.post .photo img {
border: solid 10px #eee;
}
.post .photo div.caption {
font-size:11px;
color:#444;
margin-top: 5px;
}
.post .photo div.caption a {
color:#444;
}
/* Quote Post */
.post .quote span.quote {
font: Bold 28px Lucida Sans;
letter-spacing: -1px;
color:#666;
}
.post .quote span.quote a {
color:#666;
}
.post .quote span.quote big.quote {
font: Bold 60px Georgia, serif;
line-height: 8px;
vertical-align: -20px;
}
.post .quote span.source {
font-size:16px;
font-weight: Bold;
color:#444;
letter-spacing: -1px;
}
.post .quote span.source a {
color:#444;
}
/* Link Post */
.post .link a.link {
font: Bold 20px Lucida Sans;
letter-spacing: -1px;
color:#c00;
}
.post .link span.description {
font-size: 13px;
font-weight: normal;
letter-spacing: -1px;
}
/* Conversation Post */
.post .conversation ul {
background-color: #f8f8f8;
list-style-type: none;
margin: 0px;
padding: 0px;
border-left: solid 5px #ddd;
}
.post .conversation ul li {
border-bottom:solid 1px #ddd;
font-size:12px;
padding: 4px 0px 4px 8px;
color:#444;
}
.post .conversation ul li span.label {
font-weight: bold;
color:#111;
}
/* Audio Post */
.post .audio div.caption {
font-size:11px;
color:#444;
margin-top: 5px;
}
.post .audio div.caption a {
color:#444;
}
/* Video Post */
.post .video {
width:400px;
margin: auto;
}
.post .video div.caption {
font-size:11px;
color:#444;
margin-top: 5px;
}
.post div.video div.caption a {
color:#444;
}
/* Footer */
#footer {
margin: 40px 0px 30px 0px;
text-align: center;
font-size:12px;
}
#footer a {
text-decoration: none;
color:#444;
}
#footer a:hover {
text-decoration: underline;
}
.query { font-weight: bold; }