page background color

565 views
Skip to first unread message

Robert Lockwood

unread,
Jul 26, 2011, 4:12:45 PM7/26/11
to google-we...@googlegroups.com
I'm really new at all this but really frustrated in that I cannot change the page background color in the GWT example MyWebApp that demonstrates Asynch.

I put this in the CSS file, both as the first item and then as the last. (Tried other things as well.)

body {
    background-color: #FFFFD2;
}


Occasionally when the page loads it quickly blinks the color but always displays a white background. Why is this happening?

I'm using Eclipse Helios on Ubuntu.



--
When I was 12 I thought I would live forever.
So far, so good.

Jeff Chimene

unread,
Jul 26, 2011, 4:15:40 PM7/26/11
to google-we...@googlegroups.com
On 07/26/2011 01:12 PM, Robert Lockwood wrote:
> I'm really new at all this but really frustrated in that I cannot change
> the page background color in the GWT example MyWebApp that demonstrates
> Asynch.
>
> I put this in the CSS file, both as the first item and then as the last.
> (Tried other things as well.)
>
> body {
> background-color: #FFFFD2;
> }
>
>
> Occasionally when the page loads it quickly blinks the color but always
> displays a white background. Why is this happening?
>
> I'm using Eclipse Helios on Ubuntu.

Maybe use Firebug to display to CSS that's in effect.

Anky

unread,
Jul 26, 2011, 4:38:48 PM7/26/11
to Google Web Toolkit
Did you try putting a DOT before your CSS code

.body {
background-color: #FFFFD2;
}

If you want to set this to a panel then use
panel.setStylePrimaryName("body");

Also check whether you have included the name of your CSS file in html
file

Compile and re-run your app

Best
-Ankit
> Maybe use Firebug to display to CSS that's in effect.- Hide quoted text -
>
> - Show quoted text -

Robert Lockwood

unread,
Jul 26, 2011, 5:14:51 PM7/26/11
to google-we...@googlegroups.com
Using the ".body" had no effect.

Where does "panel.setStylePrimaryName("body");" go?  In the CSS file?  

Thanks,
Nate


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Jeff Chimene

unread,
Jul 26, 2011, 5:20:27 PM7/26/11
to google-we...@googlegroups.com
On 07/26/2011 02:14 PM, Robert Lockwood wrote:
> Using the ".body" had no effect.
>
> Where does "panel.setStylePrimaryName("body");" go? In the CSS file?
>
> Thanks,
> Nate

It doesn't go in the CSS file.

Did you take a look at the CSS via Firebug as I suggested?

If your HTML looks like
<body>
.
.
.
</body>

then the suggested selector won't work. For it to work, you'd need
<body class=".body">
.
.
.
</body>

Robert Lockwood

unread,
Jul 26, 2011, 6:15:30 PM7/26/11
to google-we...@googlegroups.com
I installed FireBug lite in my Chrome browser and inspected the css and html files which appear to be identical to my project files.

I edited the <body> to read <body class=".data"> to match the CSS file but that did not solve the problem.

I'm not using the panel statement as I don't know where it should go.

Nate





--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Philippe Blanc

unread,
Jul 26, 2011, 6:18:18 PM7/26/11
to google-we...@googlegroups.com
It's <body class="data"> without the dot when declared in HTML - the dot in the CSS file mean class

Jeff Chimene

unread,
Jul 26, 2011, 6:37:13 PM7/26/11
to google-we...@googlegroups.com
On 07/26/2011 03:15 PM, Robert Lockwood wrote:
> I installed FireBug lite in my Chrome browser and inspected the css and
> html files which appear to be identical to my project files.
>
> I edited the <body> to read <body class=".data"> to match the CSS file
> but that did not solve the problem.
>
> I'm not using the panel statement as I don't know where it should go.
>
> Nate
>
>
>
>
> On Tue, Jul 26, 2011 at 2:20 PM, Jeff Chimene <jchi...@gmail.com
> <mailto:jchi...@gmail.com>> wrote:
>
> On 07/26/2011 02:14 PM, Robert Lockwood wrote:
> > Using the ".body" had no effect.
> >
> > Where does "panel.setStylePrimaryName("body");" go? In the CSS file?
> >
> > Thanks,
> > Nate
>
> It doesn't go in the CSS file.
>
> Did you take a look at the CSS via Firebug as I suggested?
>
> If your HTML looks like
> <body>
> .
> .
> .
> </body>
>
> then the suggested selector won't work. For it to work, you'd need
> <body class=".body">

Ugh. I can't believe I wrote .body

Obviously, it should be class="body"

Philippe Blanc

unread,
Jul 26, 2011, 6:40:38 PM7/26/11
to google-we...@googlegroups.com
lol! in fact my brain automatically removed the '.' in your response. But that suddenly hit me in Robert's response.

Robert Lockwood

unread,
Jul 26, 2011, 7:06:00 PM7/26/11
to google-we...@googlegroups.com
Thank you all, it worked.

Now to address the next problem.  I have a pocket guide to CSS and an introduction to HTML 5 but they have not helped much.

Nate

Andrei

unread,
Jul 27, 2011, 5:15:13 AM7/27/11
to Google Web Toolkit
This should work:

body {
background-color: #FFFFD2 !important;
}

There is no need to mess with setting a class in your code.

Andrei

Thomas Broyer

unread,
Jul 27, 2011, 6:18:38 AM7/27/11
to google-we...@googlegroups.com
Well, how about simply not using a given theme if it doesn't suit you? Or, put differently, copy and tweak it to your needs/taste rather than "hacking around".
Reply all
Reply to author
Forward
0 new messages