Window background image

asked 2015-05-19 14:59:21 +0800

greendragon gravatar image greendragon
25 4

Hi, I'm new about ZK development. I just want to create a simple login page with a background image. Maybe my question is stupid but I can't insert the background image. I tried various solutions without solve the problem.

            body {
            background-repeat: no-repeat}

 <window id="loginWin"
             .... login fields ...

I've no idea how proceed...


delete flag offensive retag edit

3 Answers

Sort by ยป oldest newest most voted

answered 2015-05-20 01:38:42 +0800

echarish gravatar image echarish flag of Japan
1809 7

updated 2015-05-20 03:22:16 +0800


if you just want a image as background to your window use

contentStyle=" background-image:url('/image/background/bground_home.png')"

 <window border="normal"  contentStyle=" background-image:url('/image/background/bground_home.png')"  width="800px" height="800px">

in your window tag.

I have created a fiddle for you to see it implimented


Hope it helps


link publish delete flag offensive edit

answered 2015-05-19 22:53:20 +0800

Darksu gravatar image Darksu
1991 1 4

updated 2015-05-19 22:54:04 +0800

Hello greendragon,

You could create a div and apply the following style with better results:

<div style="    
   background: url(img/image.jpg) no-repeat center center fixed; 
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
  height: 100%;"

Best Regards,


link publish delete flag offensive edit

answered 2015-05-21 15:36:45 +0800

greendragon gravatar image greendragon
25 4

Thanks for replies. I used Darksu solution, because using contentStyle in window it's only possible to set the beackground for the login window, not for the whole page. Is this the better solutions? Thanks

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

1 follower



Asked: 2015-05-19 14:59:21 +0800

Seen: 40 times

Last updated: May 21 '15

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More