0

I'm trying to put an image up for my header. I currently have it set as a background image, which is repeating. Obviously, I'm doing it wrong. What is the correct img code?

1
  • If you want to use background-image, but don't want to repeat, use background-repeat:no-repeat. Other than that, I'm not really sure what your trying to achieve. Commented Oct 27, 2011 at 21:41

2 Answers 2

6
#header { background: url(path/to/your/image.jpg) no-repeat; }
Sign up to request clarification or add additional context in comments.

1 Comment

The long form of this would be: background-image:url(image.jpg); background-repeat:no-repeat;
0
#header {background: url(your image.png) no-repeat;}

and if you want to give padding or margin to any inline-element; don't forgot to used inline-block property. It is very useful.

Comments

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.