开发者

HTML Font list dropdown

Is there a script or function I can call to create a font dropdown menu? Of a lot of fonts? so once selected it can be used in an from the database on to the website? (aka let the user select their font type):

More specifically the five or so standard "Web safe" fonts.

Or can someone just list 开发者_开发知识库those 5 fonts for when using them in html.

Ex:

<font face="????">Text</font>


You could do this entirely in css if you wish:

<select>
    <option class="font1"></option>
    <option class="font2"></option>
    <option class="font3"></option>
    <option class="font4"></option>
    <option class="font5"></option>
</select>

<style>
    .font1 {font-family:arial}
    .font2 {font-family:monospace}
    ... etc
</style>

Also I would avoid using the font tag, it's deprecated as of HTML4 I believe. If you have a ridiculous amount of fonts I would automate the markup generation with PHP or another HTML geared language of your choice. If you need specifics on how to do this just let me know.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜