1

I am trying to set this image: http://www.flaticon.com/free-icon/linkedin-logo_34405#term=linkedin&page=1&position=1 as my background image, but it doesn't work...

Error in parsing value for 'background-image'. Declaration dropped.

Code(HTML):

<div class="linkedin"></div>

Code(CSS):

.linkedin {
    display: inline;
    background-image: url(../images/Linkedin(Idle).png);
    width: 16px;
    height: 16px;
}
1
  • Where do you get that error? BTW inline elements don't have width or height. Commented Nov 2, 2015 at 14:45

2 Answers 2

2

Try this:

.linkedin {
    display: inline;
    background-image: url('../images/Linkedin(Idle).png');
    width: 16px;
    height: 16px;
}

The parenthesis in the middle are interfering with the parser, and it's assuming the image ends right after Idle)

Sign up to request clarification or add additional context in comments.

Comments

1

Change display: inline; with display: inline-block;, also add background properties:

.linkedin {
    display: inline-block;
    background-image: url('../images/Linkedin(Idle).png');
    background-repeat: no-repeat;
    background-position: 0 0;
    width: 16px;
    height: 16px;
}

1 Comment

Thanks, this worked i am going to accept as soon as stackoverflow let's me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.