发博文
dorainm's blog

http://blog.chinaunix.net/space.php?uid=20396006

<table width="100%"> <tr><td> <script type="text/javascript"><!-- google_ad_client = "pub-9869018759147556"; //468x60,11/21/07,dorainm.cublog.cn google_ad_slot = "4165281795"; google_ad_width =    
个人资料
  • 博客访问:775636
  • 博文数量:197
  • 博客积分:10010
  • 博客等级:上将
  • 注册时间:2007-06-15 17:05:15
订阅我的博客
  • 订阅
  • 订阅到鲜果
  • 订阅到抓虾
  • 订阅到Google
字体大小: 博文
css中的url (2008-11-07 15:44)
分类: HTML/CGI

如果不是填写绝对路径的话,css中的url路径,即相对路径,是相对这个 .css文件的路径。

比如 http://localhost 目录在 /var/www/html,而 /var/www/html/style里面有个 dorainm.css,在/var/www/html/images里面有张图片dorainm.png,

当 http://localhost的 index.php包含 style.css的时候,即

<link href="./style/dorainm.css" type="text/css" rel="stylesheet">


那 dorainm.css里面的某条语句,比如

background:#000000 url(../images/dorainm.png) repeat top left;


要填写成这种,dorainm.png是相对 dorainm.css的位置为 ../images/,而不是写成相对 index.php的 ./images/dorainm.png

亲,您还没有登录,请[登录][注册]后再进行评论