滑动门
该文档正在不断扩充。
滑动门是一种利用CSS来控制自适应导航栏外观的一种技术。
当满足以下条件,则可能需要使用到滑动门技术:
- 导航边框样式为非矩形,或者导航栏背景图片有阴影等装饰性效果。
- 在未知文字数量的情况下,导航栏自动适应宽度。
在制作滑动门以前,您需要斟酌到底能不能用低成本的方法实现。不是所有的效果图上的自适应导航都能用滑动门来实现。壁如,当效果图上的文字使用了特殊效果(阴影,浮雕,外发光等等),因为无法通过修改xhtml中的文字,来达到修改图片上文字,因此,滑动门在这种情况下并不适用。
这张图片列举了何时该使用滑动门:
文件:http://home.blueidea.com/attachment/200902/16/381636 12347914609M9M.png alt="使用滑动门前的考虑"
从图中可以找出规律,当背景图片垂直方向可以分成3部分,既可以使用滑动门,如不满足此条件,则可能会花费更大的成本(包括额外的className和更多的css规则)。
以下代码所需的背景图片: 文件:http://home.blueidea.com/attachment/200902/16/381636 123479339869Hd.gif.thumb.jpg
[[[首先,需要建立xhtml结构。一共有2种结构可供选择,查看这两种结构的优缺点:]]] 第一种:
无效的语言。
您需要指定一种语言,像这样: <source lang="html4strict">...</source>
语法高亮所支持的语言:
4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, arm, asm, asp, asymptote, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcl, dcpu16, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, freeswitch, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, haxe, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, ldif, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, nagios, netrexx, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, octave, oobas, oorexx, oracle11, oracle8, oxygene, oz, parasail, parigp, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, pys60, python, q, qbasic, rails, rebol, reg, rexx, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, spark, sparql, sql, stonescript, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, upc, urbi, uscript, vala, vb, vbnet, vedit, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic
<ul id="navigation"> :<li><a href="http://bbs.blueidea.com/">蓝色理想主站</a></li> :<li><a href="http://bbs.blueidea.com/">经典论坛</a></li> :<li><a href="http://bbs.blueidea.com/">维基</a></li> :<li><a href="http://pages.blueidea.com/">Think.Pages</a></li> :<li><a href="http://desk.blueidea.com/">桌面</a></li> </ul>
第二种:(推荐)
无效的语言。
您需要指定一种语言,像这样: <source lang="html4strict">...</source>
语法高亮所支持的语言:
4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, arm, asm, asp, asymptote, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcl, dcpu16, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, freeswitch, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, haxe, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, ldif, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, nagios, netrexx, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, octave, oobas, oorexx, oracle11, oracle8, oxygene, oz, parasail, parigp, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, pys60, python, q, qbasic, rails, rebol, reg, rexx, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, spark, sparql, sql, stonescript, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, upc, urbi, uscript, vala, vb, vbnet, vedit, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic
<ul id="navigation"> :<li><a href="http://bbs.blueidea.com/"><span>蓝色理想主站</span></a></li> :<li><a href="http://bbs.blueidea.com/"><span>经典论坛</span></a></li> :<li><a href="http://bbs.blueidea.com/"><span>维基</span></a></li> :<li><a href="http://pages.blueidea.com/"><span>Think.Pages</span></a></li> :<li><a href="http://desk.blueidea.com/"><span>桌面</a></span></li> </ul>
[[[开始书写CSS代码]]]