jwcane Posted June 14, 2014 Share Posted June 14, 2014 My css has a background style with non-repeating image, that works fine: .HeaderImg1b { background-image: url("/photodesign/images/pgHeader-1b.jpg"); background-repeat:no-repeat; } To create that image on the fly, the <div style tag is more convenient, as in: <div style="background: url(/photodesign/images/pgHeader-1b.jpg)>" </div> This latter code has some error that is preventing the image from being rendered. Have also tried adding quotes inside parens with and without the outer set of quotes, and no quotes. Behavior is unchanged. Would appreciate an idea of what is wrong. Link to comment Share on other sites More sharing options...
davej Posted June 14, 2014 Share Posted June 14, 2014 The relative addressing could be an issue if your external css file is in a different folder. Also note that in one case you have background and in the other you have background-image. Link to comment Share on other sites More sharing options...
jwcane Posted June 14, 2014 Author Share Posted June 14, 2014 Changed to Background-Image, with no change in results. Link to comment Share on other sites More sharing options...
davej Posted June 14, 2014 Share Posted June 14, 2014 Try just creating a class and a style in the head for that div rather than inline. Link to comment Share on other sites More sharing options...
dsonesuk Posted June 14, 2014 Share Posted June 14, 2014 (edited) <div style="background: url(/photodesign/images/pgHeader-1b.jpg)>" </div> should be <div style="background-image: url(/photodesign/images/pgHeader-1b.jpg);"> </div> and it does help to set the height, else it will 0 height, and WILL show nadder. Edited June 14, 2014 by dsonesuk Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now