nngs
发表于 2004-6-25 21:27
|
显示全部楼层
|阅读模式
来自: 美国–新泽西州–伯灵顿 Comcast有线通信控股股份有限公司
以前玩老版本的VBB时看到的. 也许对牧夫用的版本有些参考价值.
这个技巧提到的Font face在牧夫这里好象变成了Font Style.
下面是技巧的实现:
[B]
An easy way to save loads of bandwidth
Saving bandwidth is good for everyone, so here is a little tip to save absolutely buckets of it.
You may have noticed in your styles CP that there is an option to specify a 'class' for the various font sizes. This is what it's for
Normally, if you use the default settings, every single piece of text on a vBulletin page will be surrounded by <font> tags, each of which contain this sort of information (view the source of this page and you'll see)
code:--------------------------------------------------------------------------------<font face="verdana, arial, helvetica, sans-serif" size="2">--------------------------------------------------------------------------------
You'll see that code repeated hundreds of times all over the pages. Wouldn't if be good if we could somehow take that formatting information and store it centrally in the HTML, then have all the <font> tags reference that single source?
Well you can.
Let's try it for the most common tag - <normalfont>.
Normally, <normalfont> is replaced with this sort of thing: <font face="verdana, arial, helvetica, sans-serif" size="2"> because your settings for <normalfont> look like this:
Let's get rid of all that superfluous information, and simply replace it with a CSS style definition:
<normalfont> will now be replaced with
code:--------------------------------------------------------------------------------<font class="nf">--------------------------------------------------------------------------------
This is much, much smaller than that long definition we had before, but how do we tell it what font and size we want it to use?
Look up at the top of your styles control panel, and you will see an area where you can edit the headinclude template. By default, your headinclude will look like this:
code:--------------------------------------------------------------------------------<meta http-equiv="MSThemeCompatible" content="Yes">
<style type="text/css">
BODY {
SCROLLBAR-BASE-COLOR: {categorybackcolor};
SCROLLBAR-ARROW-COLOR: {categoryfontcolor};
}
SELECT {
FONT-FAMILY: Verdana,Arial,Helvetica,sans-serif;
FONT-SIZE: 11px;
COLOR: #000000;
BACKGROUND-COLOR: #CFCFCF
}
TEXTAREA, .bginput {
FONT-SIZE: 12px;
FONT-FAMILY: Verdana,Arial,Helvetica,sans-serif;
COLOR: #000000;
BACKGROUND-COLOR: #CFCFCF
}
#all A:link, #all A:visited, #all A:active {
COLOR: {linkcolor};
}
#all A:hover {
COLOR: {hovercolor};
}
#cat A:link, #cat A:visited, #cat A:active {
COLOR: {categoryfontcolor};
TEXT-DECORATION: none;
}
#cat A:hover {
COLOR: {categoryfontcolor};
TEXT-DECORATION: underline;
}
#ltlink A:link, #ltlink A:visited, #ltlink A:active {
COLOR: {linkcolor};
TEXT-DECORATION: none;
}
#ltlink A:hover {
COLOR: {hovercolor};
TEXT-DECORATION: underline;
}
.thtcolor {
COLOR: {tableheadtextcolor};
}
</style>
$headnewpm--------------------------------------------------------------------------------
Just before the closing </style> tag, we will now add our central definition for how <normalfont> will be formatted. Add this:
code:--------------------------------------------------------------------------------.nf {
FONT-FAMILY: verdana, arial, helvetica, sans-serif;
FONT-SIZE: 13px;
}--------------------------------------------------------------------------------
This CSS class definition will now be called for ALL the <normalfont> tags, so your resulting HTML pages will be much smaller. Repeat this for <smallfont> and <largefont> and you're laughing |
|