Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Setting a website background
TheSkiMC
New
I would like to set the background of my entire site to be a certain image. How would I go about doing this (I have HTML and CSS exp. but little in PHP)
0
Best Answer
-
jackmaessen ✭✭✭
Most easy is: open your default.master.tpl in themes/yourtheme/views/default.master.tpl
en place in the body tag:<body background="/path/to/your/image.png" ........
5
Answers
Most easy is: open your default.master.tpl in themes/yourtheme/views/default.master.tpl
en place in the body tag:
<body background="/path/to/your/image.png" ........
Thanks, ignorantly ignored the .tpl thinking it was going to be in some alien language!
Don't put style information in your markup!
Open your theme's custom.css file (located in
/themes/ThemeName/design/custom.css
) and add the background rule to the body selector.Why should you separate style from markup? http://en.wikipedia.org/wiki/Separation_of_presentation_and_content
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
[offtopic]
Actually, this is a little bit strange. If someone gives an answer on a question, and it is the only answer so far, when accepting the answer by topicstarter, it becomes the best answer. To become the best answer, you should have at least more answers to compare with to become the best one... In my opinion, in stead of "Best Answer" there should be displayed "Accepted Answer'
I agree with @hgtonight . That is a more proper way to do it.
I think the fact that it allowed me to do what I wanted to do means that it didn't require any more attention and therefore I marked it as Answered. I'll decide whether someone has answered my questions, thank you.
@TheSkiMC that is all very well, but sometimes the first solution isn't the best one.
In html5 this attribute is not longer supported. It is a remnant from html3.
css gives you more control over the background, and has greater compatibility.
grep is your friend.