autofans
V2EX  ›  问与答

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

  •  
  •   autofans · Sep 14, 2014 · 3494 views
    This topic created in 4433 days ago, the information mentioned may be changed or developed.
    写成这样貌似无效,图片还是撑的很大。。。
    #logo a {
    cursor: pointer;
    display: block;
    height: 40px;
    line-height: 100em;
    overflow: hidden;
    width: 100px;
    }
    4 replies  •  2014-09-14 17:54:46 +08:00
    ThomasChan
    ThomasChan
    Sep 14, 2014
    1
    a{
    position:fixed;
    top:0;
    left:0;
    }
    a img{display:block;width:100%}
    underone
    underone
    Sep 14, 2014
    2
    作为背景固定写在body上不可以么
    kisshere
    kisshere
    Sep 14, 2014
    3
    @underone body{background:url(site_logo.png) no-repeat 0px 0px;}
    thinkxen
    thinkxen
    Sep 14, 2014 via Android
    4
    唉,好捉急
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4928 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 06:04 · PVG 14:04 · LAX 22:04 · JFK 01:04
    ♥ Do have faith in what you're doing.