| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
is gta4 addicted..
Join Date: Apr 2008
Location: San Diego, CA
Posts: 24
|
z-index?
hello again, ok so my computer crashed on me a couple of days ago due to a horrible vista bug that cost me almost 20GB of irrecoverable data, all i tried to do was run the built in disk cleanup util and thank god i cancelled in time before windows literally ate itself up, but anyways, back up again and very frustrated and deadlines approaching so im doing everything again from scratch. basic layout, i want a centered div with a drop shadow on both sides. i started with a container, aligned it to the center, two divs on top of each other inside of it, one with the shadow and the top one with the content. i am trying to set the background color in the body tag to black so it matches the fadeout color of the shadow, but its not working for some reason, its staying white. is it becasue i am using z-index ?? (ive never used it before). here is the CSS and html again. CSS: body { margin: 0; padding: 0; text-align: center; background: #000000; } #container { width: 80%; margin: 0 auto; } #contentBack { position:absolute; top: 0; z-index: 0; width: 975px; height: 100%; margin-left:0; background-image: url(images/bg2.png); background-repeat: repeat-y; } #contentFront { position: absolute; top: 0; z-index: 1; width: 925px; height: 100%; margin-left:25px; background-image: url(images/WSNEW.png); } HTML: <body> <div id="container"> <div id="contentBack"></div> <div id="contentFront"></div> </div> </body> </html> |
|
|
|
|
|
#3 (permalink) |
|
shouting at a monitor!
Join Date: May 2008
Location: Glasgow, Scotland
Posts: 10
|
you should change the code to Code:
As having the short hard code "background" with only 1 attribute will cause it to fail css validation such as AAA. Only ever use shorthand if you are using multiple attributes ie; Code:
I know you fixed the bug, but thats just a bit of advice |
|
|
|
#4 (permalink) |
|
Moderator
Join Date: Jan 2005
Location: Brooklyn, NYC
Posts: 11,869
|
You can also shorten many hex color codes. #000 = #000000 #AC9 = #AACC99 Find good advice in the beginners web design thread.
patrick o'neill web developer | blog | spam humor |
|
|
|
#6 (permalink) | |
|
unusual suspect ™
Join Date: Jul 2004
Location: DE, USA
Posts: 2,511
|
Quote:
background: #000; is perfectly valid and IMO preferable to the long version. |
|
|
|
|
#7 (permalink) | |
|
Moderator
Join Date: Jan 2005
Location: Brooklyn, NYC
Posts: 11,869
|
Quote:
Using... Code:
Code:
Find good advice in the beginners web design thread.
patrick o'neill web developer | blog | spam humor |
|
|
|
|
#8 (permalink) |
|
now with added beard
Join Date: Mar 2004
Location: Liverpool
Posts: 4,963
|
i do know that CSS validation and AAA are two entirely different things ... i use background: #000; it may bring up a css warning - but who cares ... its still valid. fuck signatures
|
|
![]() |