V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
autofans
V2EX  ›  问与答

如果想把网站的 logo 图片固定在主页的左上角,CSS 要怎么写?

  •  
  •   autofans · 2014-09-14 16:22:33 +08:00 · 2739 次点击
    这是一个创建于 3529 天前的主题,其中的信息可能已经有所发展或是发生改变。
    写成这样貌似无效,图片还是撑的很大。。。
    #logo a {
    cursor: pointer;
    display: block;
    height: 40px;
    line-height: 100em;
    overflow: hidden;
    width: 100px;
    }
    4 条回复    2014-09-14 17:54:46 +08:00
    ThomasChan
        1
    ThomasChan  
       2014-09-14 16:29:31 +08:00
    a{
    position:fixed;
    top:0;
    left:0;
    }
    a img{display:block;width:100%}
    underone
        2
    underone  
       2014-09-14 16:36:08 +08:00
    作为背景固定写在body上不可以么
    kisshere
        3
    kisshere  
       2014-09-14 17:13:29 +08:00
    @underone body{background:url(site_logo.png) no-repeat 0px 0px;}
    thinkxen
        4
    thinkxen  
       2014-09-14 17:54:46 +08:00 via Android
    唉,好捉急
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5657 人在线   最高记录 6547   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 08:51 · PVG 16:51 · LAX 01:51 · JFK 04:51
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.