CSS for flash messages


#1

Hello all,

I’m perplexed by the following:

I’ve implemented flash messages in my application.rhtml with:

<% for name in [:notice, :warning, :message] %>
<% if flash[name] %>
<%= “<p id=”#{name}" class=“flash”>#{flash[name]}

" %>
<% end %>
<% end %>

I’ve implemented CSS in application.rhtml with:

<%= stylesheet_link_tag “avcnotes” %>

Now, each of these things works–my flash messages appear when they
should, and my styles are applied to all the pertinent elements…EXCEPT
flash messages. In avcnotes.css I have (among other things):

.notice {
color:yellow
}
.warning {
color:red
}
.message {
color:yellow
}
#flash {
border:1px solid black;
width:100%;
text-align:center
}

No matter what I’ve tried, these styles are not applied to my flash
messages. Is there a step/trick/hack I’m missing here?

Thanks in advance,

-ELf


#2

Matthew F. wrote:

Hello all,

Now, each of these things works–my flash messages appear when they
should, and my styles are applied to all the pertinent elements…EXCEPT
flash messages. In avcnotes.css I have (among other things):

.notice {
color:yellow
}
.warning {
color:red
}
.message {
color:yellow
}
#flash {
border:1px solid black;
width:100%;
text-align:center
}

No matter what I’ve tried, these styles are not applied to my flash
messages. Is there a step/trick/hack I’m missing here?

You’ve got your signifiers switched. # is the code for “id” and . is
the code for “class”.

#notice

#warning

#message

and

.flash

Jeff C.man


#3

you’ve got your id’s and classes backwards…


#4

Jeff C.man wrote:

You’ve got your signifiers switched. # is the code for “id” and . is
the code for “class”.

Well, don’t I feel silly.

Many thanks, gentlemen!

-ELf