Hi from beautiful sunset out of the window York UK,
I want to get different back ground images on different pages. My attempts to add classes on the body tag have resulted in one big epic fail.
Below illustrates the pain:
Any insights welcome
Hi from beautiful sunset out of the window York UK,
I want to get different back ground images on different pages. My attempts to add classes on the body tag have resulted in one big epic fail.
Below illustrates the pain:
Any insights welcome
Hi, David.
It would be far more helpful if you would post a link to the working site instead of building a codepen which we cannot easily duplicate on our computers.
The CSS class in your screen shot, .sandburn-wedding, looks like it is assigned to the <html>
tag. Is that true?
If it is supposed to be attached to the <body>
tag, it should follow it:
<body class="sandburn-wedding">
and the CSS might be
body.sandburn-wedding {}
This line of HTML
<div class="gridContainer.clearfix">
looks like it should have been written with a space between the classnames
<div class="gridContainer clearfix">
The dot connector is used in CSS to specify the selector where both classes exist in the HTML.
HI Ron Pat, thanks for your reply. Ok if i could work through some of your pointsā¦
1.āfar more helpful if you would post a link to the working site instead of building a codepenā¦ā OK I agree but⦠if I was to do this how would I be able to host it in ātestā environment if that makes sense. The site Iām building now will replace the live wordpress site www.davidclick.com (please no one jump on the āwhy get rid of wordpress?ā my mind id made up)
<body class="sandburn-wedding">
does make sense but my site body tag looks like this:<body onLoad="MM_preloadImages('images/york-marriott-wedding-500-500.jpg')">
I am worried if I re write it the āMM_preloadā¦ā bit will be knocked out causing other problems. So ius the idea it is ok to write <body class="sandburn-wedding">
and the CSS might be body.sandburn-wedding {} and the MM bit on line 45 of the HTML codepen can be lost with the no impact on images downloading properly?
<div class="gridContainer clearfix">
. I tried this but it bust the layout so Ive kept it in.Would be hugley gratefull if anyone coule geive me a fix to the problem of getting different background images on different pages
Thanks in advance,
David
@Nightwing: if you want inline code tags to show up, you need to type a backtick ` before and after the tag.
`<tag>`
Hah yes I was wondering how to do that Now to find a back tick on my mac keyboard!
<h1>
Found it!</h1>
looks like I may have carcked the different bk ground images on different pages problemo thanks to your help
OK but one minor questionā¦
Line 46 in the HTML āonLoad="MM_preloadImageā Iāll be honest I cant remember why I needed to put this in, think it was as suggestion from a sitepoint member to fix on hover images not appearing. Can any one reassure me I havent screwed this up by tweaking line 46?
Grazie mille
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.