Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS CSS Background image , not working

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #261668
    manufufu
    Participant

    I don’t know why the image is not showing up….
    Any help?

    This is the HTML Code

    <div class="main">
             <div id="logo">
                 <div class="jumbotron"></div>
             </div>
    </div>
    

    This is the CSS Code
    #logo{
    background:url(background.jpg) no-repeat;
    background-size:cover;
    }

    #261672
    Paulie_D
    Member

    Can you make a demo in Codepen.io rather than just dumping some code?

    #261673
    manufufu
    Participant

    https://codepen.io/anon/pen/YrbGBL
    Here it is mate.
    Assume that there is bootstrap file in it….

    #261674
    Paulie_D
    Member

    Ahhh…you are using the shorthand.

    Just add the background-size as another line…

    https://codepen.io/Paulie-D/pen/zEQowP

    or

    split the position/size keywords like position/size

    https://codepen.io/Paulie-D/pen/pWmNrN

    #261675
    bearhead
    Participant

    Your background declaration should look like this:

    background:url(https://i.ytimg.com/vi/n1sk-0k6ysc/maxresdefault.jpg) top left/cover no-repeat;
    
    #261827
    manufufu
    Participant
Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘CSS’ is closed to new topics and replies.