The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Setting BG color within spoiler div?
Emor
post Jan 25 2011, 04:12 PM
Post #1


Newbie
*

Group: Members
Posts: 15
Joined: 20-December 10
Member No.: 13,429



I have a question regarding altering color in a hidden-spoiler page for which I'm trying to set up a template.

I've posted a page to illustrate what I'm trying to do, here.

My objective is to change the background color within the spoiler div when it appears.

As you can see, I've tried setting a background-color in the ".spoiler .inner" class statement...and it does nothing.

In the second of the two examples on the page, I can set the .inner div's style to a "background-color", which accomplishes what I want...but that wipes out the "display:none" setting, which causes the spoiler to default to displaying "on"!

I bet the answer to this is painfully obvious, but I'm stumped.

This post has been edited by Emor: Jan 25 2011, 04:13 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Jan 25 2011, 05:24 PM
Post #2


WDG Member
********

Group: Root Admin
Posts: 8,365
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



I recommend that you start by fixing the CSS errors reported by the W3C's CSS validation service:
http://jigsaw.w3.org/css-validator/validat...g=1&lang=en
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Emor
post Jan 25 2011, 06:25 PM
Post #3


Newbie
*

Group: Members
Posts: 15
Joined: 20-December 10
Member No.: 13,429



Thanks, Darin.

The fault reported at line #11 - I don't understand, as there was no doubling of the hex color in the code there.

But the lack of the semicolon in the second error was something that had slipped right past Dreamweaver's validator, and was, of course, the fix.

I will henceforth utilize the W3C validator page..... blush.gif lesson learned.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Jan 25 2011, 06:29 PM
Post #4


.
********

Group: WDG Moderators
Posts: 9,630
Joined: 10-August 06
Member No.: 7



QUOTE(Emor @ Jan 26 2011, 12:25 AM) *

The fault reported at line #11 - I don't understand,

"Property bgcolor doesn't exist" --use "background-color" or "background" instead.

QUOTE
as there was no doubling of the hex color in the code there.

True, that's odd.

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 29th March 2024 - 05:05 AM