V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
autofans
V2EX  ›  问与答

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

  •  
  •   autofans · Sep 14, 2014 · 3145 views
    This topic created in 4250 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
        1
    ThomasChan  
       Sep 14, 2014
    a{
    position:fixed;
    top:0;
    left:0;
    }
    a img{display:block;width:100%}
    underone
        2
    underone  
       Sep 14, 2014
    作为背景固定写在body上不可以么
    kisshere
        3
    kisshere  
       Sep 14, 2014
    @underone body{background:url(site_logo.png) no-repeat 0px 0px;}
    thinkxen
        4
    thinkxen  
       Sep 14, 2014 via Android
    唉,好捉急
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2430 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 10:40 · PVG 18:40 · LAX 03:40 · JFK 06:40
    ♥ Do have faith in what you're doing.