Jump to content


Photo

gradient fill for background?

gradient background css

Best Answer anet , 21 March 2013 - 08:02 PM

Hello, all!

 

I guess catrina has been off-line since her comment.

 

I've managed to copy my site to a dev site, so I can make changes without scaring my client. Here's the dev site: http://www.laccdev.l...oflearning.org/

 
And I've uploaded a trial background with a horizontal element. Instead of doing this via custom css (as was required with the gradient fill), I set this as background image within the site options/color control page.  I also set it as 'fixed' instead of 'scroll'. And it's supersized.

 

Maybe it's because PageLines lite has had a few different upgrades since I last tried this, but now the problem is not there! Each page on the menu has the background image at the same distance from the top. Yay!!

 

SO...thread can be closed!

 

:)

Go to the full post


  • Please log in to reply
11 replies to this topic

#1 anet

anet

    Advanced Member

  • Members
  • PipPipPip
  • 34 posts
  • Country: Country Flag

Posted 10 March 2013 - 02:06 AM

Hi, I am pretty new to wp and pagelines and css.

But I found a site to create the css for the gradient I want for the background to my site. Here's how I added it to Custom Css in Pagelines Lite.

 

But nothing shows up. So other than the actual gradient code, there must be something obvious Css-related I'm not doing. Anyone able to help? Thanks in advance. 

 

 

 

 
//** This gradient background code was created using this website: www.colorzilla/gradient-editor/ **//
 
.gradient-bg {
  
background: #bcd9f6; 
  
  /* Old browsers */
background: -moz-linear-gradient(left, #bcd9f6 0%, #0d3d57 89%, #0a2b3f 100%); 
  
  /* FF3.6+ */
background: -webkit-gradient(linear, left top, right top, color-stop(0%,#bcd9f6), color-stop(89%,#0d3d57), color-stop(100%,#0a2b3f)); 
  
  /* Chrome,Safari4+ */
background: -webkit-linear-gradient(left, #bcd9f6 0%,#0d3d57 89%,#0a2b3f 100%); 
  
  /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(left, #bcd9f6 0%,#0d3d57 89%,#0a2b3f 100%); 
  
  /* Opera 11.10+ */
background: -ms-linear-gradient(left, #bcd9f6 0%,#0d3d57 89%,#0a2b3f 100%); 
  
  /* IE10+ */
background: linear-gradient(to right, #bcd9f6 0%,#0d3d57 89%,#0a2b3f 100%); 
  
  /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#bcd9f6', endColorstr='#0a2b3f',GradientType=1 ); 
  
  /* IE6-9 */
 
}
  


#2 batman

batman

    Bat Learning

  • Members

  • 2202 posts
  • LocationBuenos Aires, Argentina
  • Framework Version:DMS
  • Country: Country Flag

Posted 10 March 2013 - 03:09 AM

Hi anet

 

Can you provide a link to your website please.

 

First you change 

.gradient-bg 

for

.canvas #page-canvas

 

And you see what's happen

;)



#3 anet

anet

    Advanced Member

  • Members
  • PipPipPip
  • 34 posts
  • Country: Country Flag

Posted 10 March 2013 - 06:33 AM

Hi, batman, here it is: http://www.lacctemp....oflearning.org/

I made the change you suggested. Gradient doesn't show up as background. I even removed the solid blue that is there (in Color Controls/Body Background), but still the Custom Css for gradient did not work. So I put the solid blue back in for now.

Edited by anet, 10 March 2013 - 06:40 AM.


#4 Danny

Danny

    Is Awesome!

  • Moderators
  • 17533 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 10 March 2013 - 09:23 AM

Hi,

 

Basically, the code you have above is for gradients. However, the code is not targeting anything like Batman suggested. You will need to use the like this:

 

 
#site .page-canvas {}

 

And then add your gradient code inside the {  }

For example,

 

 
#site .page-canvas {
background: -webkit-linear-gradient(left, #bcd9f6 0%,#0d3d57 89%,#0a2b3f 100%); 
}

 

I recommend you give our custom CSS documentation a read, as it will certainly assist you.

 

http://support.pagel...ion/custom-css/



#5 anet

anet

    Advanced Member

  • Members
  • PipPipPip
  • 34 posts
  • Country: Country Flag

Posted 19 March 2013 - 09:54 PM

Ninja, thank you so much. Obviously I'm a total noob at web dev and css. That works! 

Will spend significant time in the documentation you linked. Thank you!



#6 anet

anet

    Advanced Member

  • Members
  • PipPipPip
  • 34 posts
  • Country: Country Flag

Posted 19 March 2013 - 10:02 PM

UGh...now I wonder why? Why the dark band I created in my gradient shows up at different distances from the top of the web page when I go to different pages in my menu. Checked it briefly in IE 10, iPad, and Chrome. Same problem.

I actually had the same problem with a nice image I had made for the background. (Which I uploaded to imgur and used custom css to load as site background, those steps were no problem.)

 

But I really want to make a nice color/texture difference in the background area above the nav bar and below it. However, whether I create those spaces in a single background image or whether I do it in this test gradient with a dark 'bar', the portion of the image I want to hang just behind the nav bar moves up and down. I can't seem to see any reason for it.

This is a slightly different question...maybe it needs moved? But it is still a problem with my gradient.

Thanks in advance for anyone willing to dig and point me in the right direction (places to learn) for answers! :)



#7 James B

James B

    Advocate

  • Members

  • 5126 posts
  • LocationSurrey - UK
  • Country: Country Flag

Posted 20 March 2013 - 04:49 AM

Each browser will render gradients differently depending on the browser. You could make a gradient images and apply that to the background. That way it would be the same in all browsers



#8 anet

anet

    Advanced Member

  • Members
  • PipPipPip
  • 34 posts
  • Country: Country Flag

Posted 20 March 2013 - 02:01 PM

Hi, James,

 

Thanks for your reply, but this is not a cross-browser problem. Just within Chrome for example, the 'dark bar' is at a different level depending on which page I go to via my navigation. It's the same problem whether the background is a custom css or a gradient image or an image. The image is not always in the same position in the background. Whether I load it in the site option color controls via wp media, or whether I host the image at a third site and do custom css to load it as background.

 

It's some problem with how pagelines is rendering background on different pages within the same site within the same browser.

 

Does anyone out there have a background with a horizontal area that stays in the same position in regard to each page, when using pagelines lite? This is a very weird problem for such a sophisticated theme.



#9 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 20 March 2013 - 02:19 PM

http://www.lacctemp....oflearning.org/ <- Is this the site in question? If so, I can't see the gradient image.



#10 anet

anet

    Advanced Member

  • Members
  • PipPipPip
  • 34 posts
  • Country: Country Flag

Posted 20 March 2013 - 02:21 PM

Hi, catrina, that is the site in question; I removed the gradient background, since I didn't want to scare off my client! lol

 

If you're online now I'll put it back in, so you can have a look.  Let me know, thanks! 

 

 

 

[Mind you, this isn't the final look I want, but I do want to find out why the positioning of the background changes on some pages. It means I can't design any background, gradient or image, to work on my site if it has any elements that look best at a certain position from the top of the page...]


Edited by anet, 20 March 2013 - 02:25 PM.


#11 anet

anet

    Advanced Member

  • Members
  • PipPipPip
  • 34 posts
  • Country: Country Flag

Posted 21 March 2013 - 08:02 PM   Best Answer

Hello, all!

 

I guess catrina has been off-line since her comment.

 

I've managed to copy my site to a dev site, so I can make changes without scaring my client. Here's the dev site: http://www.laccdev.l...oflearning.org/

 
And I've uploaded a trial background with a horizontal element. Instead of doing this via custom css (as was required with the gradient fill), I set this as background image within the site options/color control page.  I also set it as 'fixed' instead of 'scroll'. And it's supersized.

 

Maybe it's because PageLines lite has had a few different upgrades since I last tried this, but now the problem is not there! Each page on the menu has the background image at the same distance from the top. Yay!!

 

SO...thread can be closed!

 

:)



#12 James B

James B

    Advocate

  • Members

  • 5126 posts
  • LocationSurrey - UK
  • Country: Country Flag

Posted 21 March 2013 - 10:42 PM

Hi Anet,

 

Glad you got this working. Just checked your link and yes the image is displaying perfectly :-)







Also tagged with one or more of these keywords: gradient, background, css