Gradient Background CSS |
Gradient Background CSS |
carsten chr |
Apr 1 2012, 05:48 PM
Post
#1
|
Group: Members Posts: 2 Joined: 18-June 11 Member No.: 14,789 |
Hi !......
This is driving me nuts !..... In my "stylesheet_background.css" file I've put: body {background-color: #787878; background-image:-webkit-gradient(linear, left top, left bottom, from(#CDCDCD), to(#131313)); background-image:-o-linear-gradient(top, #CDCDCD, #131313); background-image:-moz-linear-gradient(top, #CDCDCD, #131313); filter:progid:DXImageTransform.Microsoft.Gradient(startColorstr='#CDCDCD', endColorstr='#131313' gradientType='0')} In the top of my webpage I've put: <!DOCTYPE HTML> The output is as follows: If I then remove the DOCTYPE, I'm getting this result: And that's how I wan't it to be (as the last example) ! When I'm scrolling down the page, the gradient background stay fixed (read: don't change). What do I do to solve this issue - I need the DOCTYPE specified to show other things correctly ! Thanks ! |
Frederiek |
Apr 3 2012, 01:41 AM
Post
#2
|
Programming Fanatic Group: Members Posts: 5,146 Joined: 23-August 06 From: Europe Member No.: 9 |
QUOTE get tiling gradients, each of the same height as the HTML element box. Not if you add height: 100%; to the CSS. |
Christian J |
Apr 3 2012, 04:36 AM
Post
#3
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
QUOTE get tiling gradients, each of the same height as the HTML element box. Not if you add height: 100%; to the CSS. Yes, that's what my first replay was about. But it feels clumsy having to do that, just like you don't have to do it for BODY background-color. BTW the tiling can be removed with CSS "background-repeat". |
Lo-Fi Version | Time is now: 23rd April 2024 - 10:58 PM |