Jump to content

CSS gradient background not showing


lbuelvas

Recommended Posts

Hi, i'm having trouble trying to make the background of my web app, i made a html file to write the code and when i open it with chrome it displays my background as intended(using a gradient), but when i take the code and put it in my UniHTMLframe, the background is just plain white, hope you can help me, thanks.

Link to comment
Share on other sites

6 hours ago, Sherzod said:

Hello, 

Sorry, can you please explain in more details? 

in my HTMLframe component i wrote my view, all shows fine, the css in the divs works well, but the body background color is always white, in fact i tryed changing the body background color with JavaScript but didn't worked, but then i resized the page in chrome and i could see something like this (see image below),  like if HTMLframe body background color couldn't be affected by JS or CSS, but behind the rendered component the modification actually occured.

when i execute the same Javascript to change the color with the same HTML code in a .HTML file executed with chrome, it works as intended, i.e. all the background turns red.

this is the code i'm using in my html file, everything works except for the background stuff:

.body{
    height: 100%;
    margin: 0;
    background-repeat: no-repeat;
    background-attachment: fixed;    
    background-image: linear-gradient(#E2FFA3, #C5DE8E);
    max-height: 100%;
    top: 100px;
    position: static;
    font-family:  "helvetica";

(won't work with plain colors or gradients)

hope you can help me, thanks for your time.

uniGUIuniHTMLframeBackgroundIssue.png

actually working.png

Link to comment
Share on other sites

Hello, 

Sorry, if I understand you correctly, you can use bodyCls of the LayoutConfig...

1. UniHTMLFrame -> LayoutConfig -> bodyCls = myframe

2 CustomCSS:

.myframe {
    height: 100%;
    margin: 0;
    background-repeat: no-repeat;
    background-attachment: fixed;    
    background-image: linear-gradient(#E2FFA3, #C5DE8E);
    max-height: 100%;
    top: 100px;
    position: static;
    font-family:  "helvetica";
}

 

Link to comment
Share on other sites

1 hour ago, Sherzod said:

Hello, 

Sorry, if I understand you correctly, you can use bodyCls of the LayoutConfig...

1. UniHTMLFrame -> LayoutConfig -> bodyCls = myframe

2 CustomCSS:


.myframe {
    height: 100%;
    margin: 0;
    background-repeat: no-repeat;
    background-attachment: fixed;    
    background-image: linear-gradient(#E2FFA3, #C5DE8E);
    max-height: 100%;
    top: 100px;
    position: static;
    font-family:  "helvetica";
}

 

Oh thanks, it worked. :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...