Regman7 Posted February 10, 2020 Share Posted February 10, 2020 Trying to modify this for different pages using page ID. Working well for the site, but I need to have different backgrounds on different pages. body { background-image: url("paper.gif");} New to this and could use some help making it work. Thanks to anyone. Link to comment Share on other sites More sharing options...
Ingolme Posted February 12, 2020 Share Posted February 12, 2020 You can put a unique class name on the <body> element of each page and have one CSS rule for each one. The other alternative is to load a page-specific stylesheet on each page, each stylesheet having a different body{} rule. Link to comment Share on other sites More sharing options...
Regman7 Posted February 21, 2020 Author Share Posted February 21, 2020 Thanks for the reply. I could use all of the help I can get. Here is what I am trying at the moment: body { background: url(IMAGE LINK) no-repeat center center; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; } body.page-id-172:before { background-image: url(IMAGE LINK); } The top (body { background is working fine. The body.page-id-XXX{ before IS NOT. Link to comment Share on other sites More sharing options...
dsonesuk Posted February 21, 2020 Share Posted February 21, 2020 using :before means you have to use content: "" property to create a type of textual element, then you have to define a area to fill, either dimensions for itself, or its parent that it will appear just inside (.page-id-172 classed element) Link to comment Share on other sites More sharing options...
Regman7 Posted February 21, 2020 Author Share Posted February 21, 2020 As I am new to this I am not clear on exactly what you mean. Please elaborate a bit more if you can. Thanks for helping. Link to comment Share on other sites More sharing options...
dsonesuk Posted February 21, 2020 Share Posted February 21, 2020 look up :before and content in tutorials 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