Board index   FAQ   Search  
Register  Login
Board index php forum :: HTML CSS

Css Gradient Background HELP!!!!

Questions and tutorials related to Cascading Style Sheets *all versions*

Moderators: macek, egami, gesf

Css Gradient Background HELP!!!!

Postby benjihubbs » Mon Dec 13, 2010 1:34 pm

Hi,

When i put a gradient background on my page using css it starts half way down the page, any ideas??

Heres the code
Code: Select all
/* --( OUTLINE )-- */
body
{ background:url('images/background.png') 0 bottom repeat-x #FFF;
  margin: 0 }

#top
{ width:960px;
  margin:0 auto;
  padding: 0;
  background:url('images/top_bg.png') repeat-x;
  height:23px; }
 
#top div
{ font:8pt Tahoma, Arial, Helvetica;
  color:#aaa }
 
#top a
{ color: #aaa;
  text-decoration: none }

#top a:hover
{ color: #fff; }

#topl
{ float:left; width:720px; padding:3px 10px }

#topm
{ float:left; width:50px }

#topr
{ float:left; width:150px; text-align:right }
 
#top_banner
{ width:940px;
  margin:auto;
  padding:10px;
  background:url('images/top_banner_bg.png') repeat-x;
  height:65px;
  font:8pt Arial, Helvetica;
  color:#aaa }

#top_bannerl
{ width:300px; float:left }

#top_bannerr
{ width:600px; float:right }
 
#top_menu
{ width:960px;
  margin:auto;
  background:url('images/menu_bg.png') repeat-x;   }
 
#top_menu td
{ background:url('images/menubg_0.png') right top no-repeat; }

#top_menu td:hover
{ background:url('images/menubg_1.png') right top no-repeat; }

#top_menu td a
{ font-size::11pt;
  color:#555;
  text-decoration: none;
  padding:0 15px}
 
#body
{ width:960px;
  margin:16px auto 0 auto;
  background:url('images/body_bg.png') 0 0 repeat-y; }
 
#bodyl
{ width:200px; float:left }

#bodyr
{ float:left; width:720px; padding:0 10px }

#footer
{ height:133px;
  margin-top:20px;
  padding: 6px;
  width:948px;
  margin:auto;
  background:url('images/body_bottom.png') 0 0 no-repeat; }

#footerl
{ width:180px; border-right: solid 1px #bdbdbd; text-align:center; float:left }

#footerm
{ width:680px; float:left; margin-left:20px; font-size:8pt;}

#footerr
{ width:60px; float:left }

.copyright
{ margin-top:10px }

.qbanner
{ margin-top:10px; }

input.search
{ background:url('images/top_search.png') 0 0 no-repeat;
  font: 9pt Arial, Helvetica;
  width:97px;
  height:19px;
  border:none;
  padding:2px 35px 0 25px;
  margin:0;}

button.login
{ background:url('images/button_bg.png') 0 0 no-repeat;
  padding:0;
  margin:0;
  margin-top:1px;
  border:none;
  width:50px;
  height:20px;}

ul.curr_link
{ margin: 0;
  padding: 0;
  list-style: none }

ul.curr_link li
{ margin-left: 0;
  margin-top:2px  }

ul.curr_link li a
{ text-decoration:underline }

ul.curr_link li a:hover
{ text-decoration:none }
   
/* --( category browser )-- */
/* 1. Drill Down */
.category
{ font: 9pt Arial, Helvetica;
  line-height: 1.76;
  color: #333;
  padding: 0 0 5px 13px;
  text-decoration: none; }
 
.category:hover
{  }

.sub_category
{ font: 9pt Arial, Helvetica;
  color: #333;
  padding-left: 30px;
  line-height: 1.76;
  text-decoration: none; }

.cur_category
{ font: bold 9pt Arial, Helvetica;
  color: #000;
  padding-left: 30px;
  line-height: 1.76;
  text-decoration: none; }

.active
{ padding:10px;
  margin-bottom:20px }

.news_separator
{ margin-bottom:10px; }

.page_separator
{ margin-bottom:24px; }

.subscribe
{ margin:24px auto;
  width: 380px; }
 

/* 2. Tree View */
.category_browser
{ margin:0 0 0 5px; padding: 0}
.category_browser ul{ /*CSS for Simple Tree Menu*/
margin: 0px;
padding: 0;
}

.category_browser li{ /*Style for LI elements in general (excludes an LI that contains sub lists)*/
background: white url('../_common/images/list.gif') no-repeat left center;
list-style: none;
padding-left: 22px;
margin-bottom: 3px;
}

.category_browser li.submenu{ /* Style for LI that contains sub lists (other ULs). */
background: white url('../_common/images/closed.gif') no-repeat left 1px;
cursor: hand !important;
cursor: pointer !important;
}

.category_browser li.submenu ul{ /*Style for ULs that are children of LIs (submenu) */
display: none; /*Hide them by default. Don't delete. */
}

.category_browser .submenu ul li{ /*Style for LIs of ULs that are children of LIs (submenu) */
cursor: default;
}
/* --( end of browser )-- */

/* --( WELCOME )-- */
.title
{ padding: 5px 0;
  font-weight: bold;
  margin-bottom: 20px;
  font-family: Helvetica, Arial, Sans-Serif;
  font-size: 18px;
  color:#666666;
  letter-spacing:-1px; }

.discount
{ font: italic 8pt Georgia, Times;
  color: darkgray;
  font-weight: bolder }

/* --( LIST )-- */
.listtitle
{ font-size: 8pt;
  font-weight:bold;
  text-decoration:none }

.listtitle:hover
{ text-decoration:none }


/* --( DETAIL )-- */
.toolbox
{ font: 8pt Arial, Helvetica; }

.toolbox a
{ border-bottom: solid 2px white }

.toolbox a:hover
{ border-bottom: solid 2px black }

.detailtitle
{ font-size:14pt;
  font-weight:bold; }

.detailsect
{ font-size:10pt;
  font-weight:bold;
  color: #777777; }

/* --( CHECKOUT )-- */
.payselect_box
{ background-color: navy;
  width: 100%;
  height: 50px;
  border: outset;
  float: left;
  text-align: center;
  font-size: 16pt;
  text-decoration: none }

.checkoutjdl
{ font-family: Trebuchet MS, Verdana,Arial,Helvetica; font-size:10pt; font-weight: bold; color: white }

.checkoutspk
{ font-family: Trebuchet MS, Verdana,Arial,Helvetica; font-size:8pt; }

.checkouttxt
{ font-family: Trebuchet MS, Verdana,Arial,Helvetica; font-size:10pt; }

.checkoutdel
{ color: #FF0000; font-weight:bold; text-decoration:none; }

/* --( Modules )-- */
.module_lr
{ width:160px;
  border:solid 1px #bbb;
  -moz-border-radius: 5px;
  -webkit-border-radius: 5px;
  margin-bottom: 30px}

.module_lr legend
{ font-weight:bold;  }

.module_lr .content
{ padding:0px; }



Thanks in advance :help: :help:
benjihubbs
New php-forum User
New php-forum User
 
Posts: 11
Joined: Sun Dec 12, 2010 3:20 am

Re: Css Gradient Background HELP!!!!

Postby cmstutorial » Sun Jun 26, 2011 9:28 am

I think it's because you have set it to bottom

Code: Select all
body
{ background:url('images/background.png') 0 bottom repeat-x #FFF;
  margin: 0 }


try setting it to top (if you wish top lace it there)

Code: Select all
body
{ background:url('images/background.png') 0 top repeat-x #FFF;
  margin: 0 }
cmstutorial
New php-forum User
New php-forum User
 
Posts: 5
Joined: Sun Jun 26, 2011 9:06 am

Re: Css Gradient Background HELP!!!!

Postby freshnet » Thu Dec 29, 2011 10:52 am

Better yet, if you just need a simple gradient use the css linear-gradient property to apply it without any image at all! There's even an IE-friendly transform version if you're not doing anything complicated. Those repeating images are no longer needed.
User avatar
freshnet
php-forum Active User
php-forum Active User
 
Posts: 252
Joined: Tue Feb 22, 2011 8:19 am
Location: Canada

Re: Css Gradient Background HELP!!!!

Postby imjoshcaleb » Thu Jun 21, 2012 11:48 am

Here just use this, quick and easy
8)
www.colorzilla.com/gradient-editor/
imjoshcaleb
New php-forum User
New php-forum User
 
Posts: 1
Joined: Thu Jun 21, 2012 11:36 am
Location: Miami, FL

Re: Css Gradient Background HELP!!!!

Postby bliss » Sun Jul 29, 2012 5:51 pm

imjoshcaleb wrote:Here just use this, quick and easy
8)
http://www.colorzilla.com/gradient-editor/

I still prefer to used repeated images for backgrounds, that way I don't have to worry about what browser support it.
bliss
New php-forum User
New php-forum User
 
Posts: 24
Joined: Sun Jul 29, 2012 5:38 pm

Re: Css Gradient Background HELP!!!!

Postby WebOutGateway » Tue Jul 22, 2014 11:57 pm

Hi, benjihubbs!

Maybe it has to do with your padding, margin or width properties.
Maybe they are overlapping each other.

Or you can easily use the CSS3 Gradients.

http://www.w3schools.com/css/css3_gradients.asp

I hope this helps. Thank you.
User avatar
WebOutGateway
New php-forum User
New php-forum User
 
Posts: 36
Joined: Mon Jun 13, 2011 9:25 pm
Location: Pasig City, Philippines


Return to CSS

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.