0

i have one div and div has one img tag but image is not showing in div

here is my code

<div id="infscr-loading" >
<img src="http://jquerystyle.com/-/img/ajaxLoader.gif" alt="Loading...">
<div>
<em>Loading the next set of posts...</em>
</div>
</div>

<style type="text/css">
#infscr-loading {
background: -moz-linear-gradient(center top , #747D84 0%, #434F56 100%) repeat scroll 0 0 transparent;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
bottom: 0;
font-size: 0.8em;
font-style: normal;
font-weight: normal;
height: 50px;
left: 50%;
margin-left: -45px;
padding-top: 20px;
position: fixed;
text-align: center;
text-indent: -999em;
width: 90px;
background-repeat:no-repeat;
background-position: center center;
}
</style>

here is my div and style sheet. why image is not showing inside the div. can anyone point out.....thanks

5 Answers 5

5

Try removing text-indent: -999em; from your css

Negative text indent hides all your text/images and other inline content -999em from view.

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

Comments

4

Your text-indent: -999em; is moving all text, including images, off the screen.

Comments

3

margin-left: -45px; and text-indent: -999em; could definitely cause that problem

1 Comment

margin-left: -45px; combined with left: 50%; puts an element that has width: 90px; on the center of the screen.
1

Depending on your doctype, try closing your image tag properly.

<img src="http://jquerystyle.com/-/img/ajaxLoader.gif" alt="Loading..." />

Also, while this probably don't have anything to do with your problem, you could clean up your style significantly. You don't need the background position and repeat, those can be merged directly into your shorthand property. The two border-radius properties can also be merged into one shorthand.

1 Comment

I wonder why this got upvoted. This is in no way a solution for the problem.
-2
  1. Check your url http://jquerystyle.com/-/img/ajaxLoader.gif
  2. should have slash before close <img src="http://jquerystyle.com/-/img/ajaxLoader.gif" alt="Loading..."/>

UPDATED:

I found that because text-indent: -999em;. If you remove it, the image will appear.

4 Comments

You could have checked yourself and see that it works. And no, no slash is required in an IMG tag, no doctype was specified, so per specs HTML5 is assumed, in HTML 5 the closing slash is not required. So, wrong on both cases mate, -1.
@Truth Oh sorry, I want to give some comment while checking his html
@Truth everybody on stack-overflow are so fast :))
:) In which case, you should have made a comment, and not an answer ;). Better luck next time :)

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.