Background color disappears when calling CSS

G

Guest

Hello all -

I'm trying to incorporate a stylesheet into an ASP.Net page but everytime I include the "LINK" code to the .css file in the HEADER location of the HTML code, the background color that I have set (which is blue) gets changed to white. Below is my code in the HTML of the ASP.NET page and then my code in the .css file. Any help is sincerely appreciated as I haven't worked with stylesheets alot in my past.

Thanks for any thoughts,
Mark

HTML code:

<HEAD><title>Property Sold Report Criteria</title><meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR"><meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE"><meta content="JavaScript" name="vs_defaultClientScript"><meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema"><LINK href="Styles.css" type="text/css" rel="stylesheet"></HEAD><body bgColor="#b0c4de" MS_POSITIONING="GridLayout"><div class="RPTCRITERIA"><form id="Form1" method="post" runat="server">
...........controls on web form
</form></div></body>

...css File

BODY
{
word-spacing: normal;
font: icon;
text-transform: none;
letter-spacing: normal;
background-color: white;
}

RPTCRITERIA
{
word-spacing: normal;
font: icon;
text-transform: none;
letter-spacing: normal;
}
 
C

Curt_C [MVP]

you have the BODY tag in the CSS set to make the background white. Why would
you think it wouldn't?

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com


Mark said:
Hello all -

I'm trying to incorporate a stylesheet into an ASP.Net page but everytime
I include the "LINK" code to the .css file in the HEADER location of the
HTML code, the background color that I have set (which is blue) gets changed
to white. Below is my code in the HTML of the ASP.NET page and then my code
in the .css file. Any help is sincerely appreciated as I haven't worked
with stylesheets alot in my past.
Thanks for any thoughts,
Mark

HTML code:

<HEAD><title>Property Sold Report Criteria</title><meta content="Microsoft
Visual Studio .NET 7.1" name="GENERATOR"><meta content="Visual Basic .NET
7.1" name="CODE_LANGUAGE"><meta content="JavaScript"
name="vs_defaultClientScript"><meta
content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema"><LINK href="Styles.css" type="text/css"
rel="stylesheet"></HEAD><body bgColor="#b0c4de"
 
G

Guest

Curt,

Logic would say that your suggestion would be correct. When I re-read the .css, I couldn't believe I had missed it but to no avail, even when I remove that line, it doesn't take the default of the body bgcolor of steel blue that I had set originally........which kinda confuses me further if I did remove that item.

Do I have to set that color somehow else other than in the BODY tag because it still shows white yet when I remove the LINK reference, it goes back to blue.

Mark


----- Curt_C [MVP] wrote: -----

you have the BODY tag in the CSS set to make the background white. Why would
you think it wouldn't?

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com


Mark said:
Hello all -
I include the "LINK" code to the .css file in the HEADER location of the
HTML code, the background color that I have set (which is blue) gets changed
to white. Below is my code in the HTML of the ASP.NET page and then my code
in the .css file. Any help is sincerely appreciated as I haven't worked
with stylesheets alot in my past.Visual Studio .NET 7.1" name="GENERATOR"><meta content="Visual Basic .NET
7.1" name="CODE_LANGUAGE"><meta content="JavaScript"
name="vs_defaultClientScript"><meta
content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema"><LINK href="Styles.css" type="text/css"
rel="stylesheet"></HEAD><body bgColor="#b0c4de"
 
D

Dan Cooper

Perhaps your style sheet has been cached by your browser? Try clearing your
cache or renaming the stylesheet.

Dan

Mark said:
Curt,

Logic would say that your suggestion would be correct. When I re-read the
..css, I couldn't believe I had missed it but to no avail, even when I remove
that line, it doesn't take the default of the body bgcolor of steel blue
that I had set originally........which kinda confuses me further if I did
remove that item.
Do I have to set that color somehow else other than in the BODY tag
because it still shows white yet when I remove the LINK reference, it goes
back to blue.
Mark


----- Curt_C [MVP] wrote: -----

you have the BODY tag in the CSS set to make the background white. Why would
you think it wouldn't?

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com


Mark said:
Hello all -
everytime
I include the "LINK" code to the .css file in the HEADER location of the
HTML code, the background color that I have set (which is blue) gets changed
to white. Below is my code in the HTML of the ASP.NET page and then my code
in the .css file. Any help is sincerely appreciated as I haven't worked
with stylesheets alot in my past. content="Microsoft
Visual Studio .NET 7.1" name="GENERATOR"><meta content="Visual Basic ..NET
7.1" name="CODE_LANGUAGE"><meta content="JavaScript"
name="vs_defaultClientScript"><meta
content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema"><LINK href="Styles.css" type="text/css"
rel="stylesheet"></HEAD><body bgColor="#b0c4de"
MS_POSITIONING="GridLayout"><div class="RPTCRITERIA"><form id="Form1"
method="post" runat="server">>
............controls on web form
 
C

Curt_C [MVP]

just move the BLUE declaration to the CSS's BODY, or give your BODY tag a
custom tag.
Oh, just one other thing....when you test this.... is this actually running
the site or are you just looking at the DESIGN view? The Design view doesn't
always show things accurately..... that's why I asked.
Oh, and that HTML code you gave...is that from programming or from the
VIEW-SOURCE in the browser? Show the VIEW-SOURCE to see what's rendered....

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com


Mark said:
Curt,

Logic would say that your suggestion would be correct. When I re-read the
..css, I couldn't believe I had missed it but to no avail, even when I remove
that line, it doesn't take the default of the body bgcolor of steel blue
that I had set originally........which kinda confuses me further if I did
remove that item.
Do I have to set that color somehow else other than in the BODY tag
because it still shows white yet when I remove the LINK reference, it goes
back to blue.
Mark


----- Curt_C [MVP] wrote: -----

you have the BODY tag in the CSS set to make the background white. Why would
you think it wouldn't?

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com


Mark said:
Hello all -
everytime
I include the "LINK" code to the .css file in the HEADER location of the
HTML code, the background color that I have set (which is blue) gets changed
to white. Below is my code in the HTML of the ASP.NET page and then my code
in the .css file. Any help is sincerely appreciated as I haven't worked
with stylesheets alot in my past. content="Microsoft
Visual Studio .NET 7.1" name="GENERATOR"><meta content="Visual Basic ..NET
7.1" name="CODE_LANGUAGE"><meta content="JavaScript"
name="vs_defaultClientScript"><meta
content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema"><LINK href="Styles.css" type="text/css"
rel="stylesheet"></HEAD><body bgColor="#b0c4de"
MS_POSITIONING="GridLayout"><div class="RPTCRITERIA"><form id="Form1"
method="post" runat="server">>
............controls on web form
 
G

Guest

Thanks to your responses Dan and Curt

In regards to the questions, I'm just looking at it in Design View after I update the .css file and the code I gave was from my development environment and not source so I will look into that as well.

I did notice that it works fine when I place it into the BODY tag but since I'm desiring that pages are different colors as backgrounds, I'd rather create a separate class in the CSS. I'm not well versed in CSS but if I create a separate class, I cannot use a DIV tag inside of the BODY to bring up the blue, right? (see below

<BODY><DIV class="RPTCRITERIA"
.............the page's control
</DIV></BODY

Sorry for all of the suggestions but thanks for all your help

Mar

----- Curt_C [MVP] wrote: ----

just move the BLUE declaration to the CSS's BODY, or give your BODY tag
custom tag
Oh, just one other thing....when you test this.... is this actually runnin
the site or are you just looking at the DESIGN view? The Design view doesn'
always show things accurately..... that's why I asked
Oh, and that HTML code you gave...is that from programming or from th
VIEW-SOURCE in the browser? Show the VIEW-SOURCE to see what's rendered...

--
Curt Christianso
Owner/Lead Developer, DF-Softwar
www.Darkfalz.co


..css, I couldn't believe I had missed it but to no avail, even when I remov
that line, it doesn't take the default of the body bgcolor of steel blu
that I had set originally........which kinda confuses me further if I di
remove that itembecause it still shows white yet when I remove the LINK reference, it goe
back to blue
Mar
you have the BODY tag in the CSS set to make the background white
Why woul
you think it wouldn't
Curt Christianso
Owner/Lead Developer, DF-Softwar
www.Darkfalz.co
Hello all
everytim
I include the "LINK" code to the .css file in the HEADER location o th
HTML code, the background color that I have set (which is blue) get change
to white. Below is my code in the HTML of the ASP.NET page and the my cod
in the .css file. Any help is sincerely appreciated as I haven' worke
with stylesheets alot in my past content="Microsof
Visual Studio .NET 7.1" name="GENERATOR"><meta content="Visual Basi ..NE
7.1" name="CODE_LANGUAGE"><meta content="JavaScript
name="vs_defaultClientScript"><met
content="http://schemas.microsoft.com/intellisense/ie5
name="vs_targetSchema"><LINK href="Styles.css" type="text/css
rel="stylesheet"></HEAD><body bgColor="#b0c4de
MS_POSITIONING="GridLayout"><div class="RPTCRITERIA"><form id="Form1
method="post" runat="server">
............controls on web for
 
G

Guest

Figured it out......created BODY.RPTCRITERIA in the CSS and then referred to it in the BODY tag and the colors differ fine now. Thanks for the help.

Mark
----- Mark wrote: -----

Thanks to your responses Dan and Curt.

In regards to the questions, I'm just looking at it in Design View after I update the .css file and the code I gave was from my development environment and not source so I will look into that as well.

I did notice that it works fine when I place it into the BODY tag but since I'm desiring that pages are different colors as backgrounds, I'd rather create a separate class in the CSS. I'm not well versed in CSS but if I create a separate class, I cannot use a DIV tag inside of the BODY to bring up the blue, right? (see below)

<BODY><DIV class="RPTCRITERIA">
.............the page's controls
</DIV></BODY>

Sorry for all of the suggestions but thanks for all your help.

Mark

----- Curt_C [MVP] wrote: -----

just move the BLUE declaration to the CSS's BODY, or give your BODY tag a
custom tag.
Oh, just one other thing....when you test this.... is this actually running
the site or are you just looking at the DESIGN view? The Design view doesn't
always show things accurately..... that's why I asked.
Oh, and that HTML code you gave...is that from programming or from the
VIEW-SOURCE in the browser? Show the VIEW-SOURCE to see what's rendered....

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com


..css, I couldn't believe I had missed it but to no avail, even when I remove
that line, it doesn't take the default of the body bgcolor of steel blue
that I had set originally........which kinda confuses me further if I did
remove that item.because it still shows white yet when I remove the LINK reference, it goes
back to blue.
Mark
you have the BODY tag in the CSS set to make the background white.
Why would
you think it wouldn't?
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
Hello all -
everytime
I include the "LINK" code to the .css file in the HEADER location of the
HTML code, the background color that I have set (which is blue) gets changed
to white. Below is my code in the HTML of the ASP.NET page and then my code
in the .css file. Any help is sincerely appreciated as I haven't worked
with stylesheets alot in my past. content="Microsoft
Visual Studio .NET 7.1" name="GENERATOR"><meta content="Visual Basic ..NET
7.1" name="CODE_LANGUAGE"><meta content="JavaScript"
name="vs_defaultClientScript"><meta
content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema"><LINK href="Styles.css" type="text/css"
rel="stylesheet"></HEAD><body bgColor="#b0c4de"
MS_POSITIONING="GridLayout"><div class="RPTCRITERIA"><form id="Form1"
method="post" runat="server">>
............controls on web form
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top