CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 15th, 2000, 11:19 AM
Joel Cochran Joel Cochran is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Posts: 34 Joel Cochran User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
I'm setting up my first CSS page and am having a problem I do not understand.

I set up my CSS page "test.css" like this:<STYLE TYPE="text/css">

BODY {background-color: #C4C4C4}
H1 {font-family: serif; font-style: italic; font-weight: 900; font-size: xx-large; color : #CC3300}
H2 {font-family: Fantasy; font-style: normal; font-weight: 700; font-size: large; color : #666699}
P {font-family: Arial, Helvetica, sans-serif; font-style: normal; font-size: x-small; color : #993366}
B {background-color: #FFFFFF; font-size: medium}

</STYLE>

If I copy this code directly into my <HEAD> section, it all works as expected, but when I replace this with a <LINK REL="test.css"> statement, the background and bold styles do not work while all the rest work the same.

Any ideas???

Joel

Reply With Quote
  #2  
Old December 15th, 2000, 01:11 PM
colin_anderson colin_anderson is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 41 colin_anderson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Use this exactly as it appears below:

P {
Font-Family : Arial, Helvetica, Sans-serif ;
Font-Size : X-small ;
Color : #993366 ;
Font-Style : Normal
}
H1 {
Font-Family : Serif ;
Font-Size : XX-large ;
Color : #CC3300 ;
Font-Style : Italic ;
Font-Weight : 900
}
H2 {
Font-Family : Fantasy ;
Font-Size : Large ;
Color : #666699 ;
Font-Style : Normal ;
Font-Weight : Bold
}
BODY {
Background-Color : #C4C4C4
}
B {
Font-Size : Medium ;
Background-Color : white
}


Also to link to it in the head section, use:

<link rel="stylesheet" type="text/css" href="text.css">

That should solve you're problem. Hope it helps! I think you just had the syntax wrong seeing as it's differnt in the .css file than it is when put into the actual page.

Happy coding!



------------------
-Colin Anderson
http://www.htmletc.net/
"There are two ways to write error-free programs. Only the third one works."

Reply With Quote
  #3  
Old December 15th, 2000, 01:45 PM
Joel Cochran Joel Cochran is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Posts: 34 Joel Cochran User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Thanks Colin...unfortunately, not quite there yet.

What I noticed is that whatever is first (in my first example it was BODY which started this whole mess because it would not show the background color. In your example it was P, which then failed to provide its own definition and instead inherited the last definition displayed before it which was H2 --- whatever is first is being ignored.

I changed it around to test it out and this proves to be true. (i.e. when I put H1 first it ignored that but did everything else.)

Is there some order of precedence that has to be followed or maybe a standard statement or something that I am missing?

Joel

Reply With Quote
  #4  
Old December 15th, 2000, 07:57 PM
darwin darwin is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Location: sf, ca, usa
Posts: 20 darwin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
dont know if this helps, but, of course, in your .css file, you dont need the <style> or </style> tags... it tricked me at first...

cheers
darwin

oh yeah, you need a closing ; before the } too.

[This message has been edited by darwin (edited December 15, 2000).]

Reply With Quote
  #5  
Old December 18th, 2000, 08:40 AM
Joel Cochran Joel Cochran is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Posts: 34 Joel Cochran User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Thanks, it was the <style> tags inside the .CSS file, so all appears well, at least for the time being!

Thanks again,
Joel

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > CSS Link and Background problems


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway