/    Sign up×
Community /Pin to ProfileBookmark

Image rendering problem

Hi, i dont think im doing this wrong, however i cannot get any of my images to render from css, this is the code.

[CODE]
#right_top_box
{background:url(right_top_box.gif) no-repeat;}
[/CODE]

To me thats looks fine but it wont work, ive tried linking directly from my server html directory and ive also tried linking from a folder, ie putting all my images into a seperate folder and linking to that.

However the only way i can get it to work is to do this:

[code=html]
<div id=”right_top_box”><img src=”left_top_box.gif” alt=””/></div>
[/code]

[CODE]
#right_top_box
{background:url(right_top_box.gif) no-repeat;}
[/CODE]

As you can see i have to put the image link into the html page as well as the css page in order for it to render, but the image is a background so it should render from the css, shouldn’t it?
Am i doing it wrong? as i dont think i am
thanks.

to post a comment
CSS

7 Comments(s)

Copy linkTweet thisAlerts:
@jasonahouleNov 11.2008 — Looks okay to me. Are you sure that the image path is correct?
Copy linkTweet thisAlerts:
@no_good_at_thisauthorNov 11.2008 — Absolutely, its really wierd coz the site logo will render fine on all pages without probs and the mouseover image for that is fine too, its just page content images won't render in css alone, its drving me mad as i know im doing it right, ive tried
[CODE]
{background-image: blah;}
[/CODE]

as well as the code ive already posted and unless i put it in both html and css it wont render.

I'm really stumped
Copy linkTweet thisAlerts:
@tracknutNov 11.2008 — Is there any chance there is no content in #right_top_box, and its size is 0px?

Dave
Copy linkTweet thisAlerts:
@no_good_at_thisauthorNov 11.2008 — Ah i think i know what you mean ie no content so no background for it?

Il try that then come back in and let ya know.
Copy linkTweet thisAlerts:
@no_good_at_thisauthorNov 11.2008 — Hi again no that didn't work either
Copy linkTweet thisAlerts:
@no_good_at_thisauthorNov 11.2008 — Scratch that you rock! it did work i had spelt height wrong so the image didnt show, thanks very much thats been driving me nuts
Copy linkTweet thisAlerts:
@tracknutNov 11.2008 — Awesome ?
×

Success!

Help @no_good_at_this spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.6,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...