Wrox Programmer Forums
|
CSS Cascading Style Sheets All issues relating to Cascading Style Sheets (CSS).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the CSS Cascading Style Sheets section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 25th, 2005, 11:24 AM
Registered User
 
Join Date: Apr 2005
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rupen
Default What is wrong with this CSS?

I am not getting back ground color as mentino below, rest works fine.

<style>
    body{background-color:#D3D3D3}
    table.report
    {
        {border-collapse:separate;font-size:100%;background:#FFFF99;z-index:100;text-align:center;border: 1 solid black}
        a{color:white;text-decoration:italic;font-size:15}
        a:hover{color:white;background:green}
        z-index:1;
    }
    tr.head
    {
        {font-size:100%;background:#CCCCFF;text-align:center}
    }
    tr.foot
    {
        {font-size:100%;background:#CCFFFF;text-align:center}
    }

</style>

Rupen Anjaria.:)
------------------
We CAN'T avoid problems, but can solve it.
 
Old August 25th, 2005, 11:32 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

That's because your CSS isn't valid. You left out units of measurement, have invalid opening and closing curly braces. It should look more like this:
Code:
<style type='text/css'>
   body {
      background-color: #D3D3D3;
   }
   table.report {
      border-collapse: separate;
      font-size: 100%;
      background: #FFFF99;
      text-align: center;
      border: 1px solid black;
   }
   a {
      color: white;
      text-decoration: italic;
      font-size: 15px;
   }
   a:hover {
      color: white;
      background: green;
   }
   tr.head {
      font-size: 100%;
      background: #CCCCFF;
      text-align:center;
   }
   tr.foot {
      font-size: 100%;
      background: #CCFFFF;
      text-align: center;
   }
</style>
z-index doesn't do anything if a position of "relative" or "absolute" isn't specified.

In the future try validating your CSS:
http://jigsaw.w3.org/css-validator/

HTH!


Regards,
Rich

--
[http://www.smilingsouls.net]
Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design
 
Old August 25th, 2005, 08:52 PM
Registered User
 
Join Date: Apr 2005
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rupen
Default

Hi Richard,

I tried your script but still background color remains unchange.

While validating it gives error for:
----
   body {background-color: #D3D3D3;}
----
Other styles are applied.
----
One more thing, is there any difff between "text/css" and "css", applies to javascript also.


Rupen Anjaria.:)
------------------
We CAN'T avoid problems, but can solve it.
 
Old August 26th, 2005, 08:04 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Can't see why it would be giving you an error. Do you have a link?

Yes, there is a difference between "text/css" and just "css". The type attribute accepts a MIME type, and MIME types help to identify what a file contains. For javascript, the type is text/javascript or application/javascript, the former is more common though. Every conceivable file type has a corresponding MIME type. Some common ones are text/html, text/plain, image/jpeg, image/png, image/x-png, image/gif, application/ms-word. In web development you'll encounter these when working with email, when serving up pages over HTTP, and in HTML. It's really a big, complicated topic, but that's a brief description of what it entails.

Here's some definitions of MIME on Google:
http://www.google.com/search?q=define%3A+MIME

If you can get me a link, I can better help you to debug your CSS.

HTH!

Regards,
Rich

--
[http://www.smilingsouls.net]
Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design
 
Old August 30th, 2005, 07:48 PM
Authorized User
 
Join Date: Aug 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

what was the exact validation error and what is the html that you are applying this style sheet to?

 
Old August 30th, 2005, 07:57 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 425
Thanks: 0
Thanked 3 Times in 3 Posts
Default

I don't see anything wrong with the color either but 'text-decoration: italic' is wrong. You are probably looking for 'font-style: italic'.

Did you use the w3c validator? There are lots of crappy tools out there.

(o<
//\ =^..^=
 
Old August 31st, 2005, 03:30 AM
Registered User
 
Join Date: Apr 2005
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rupen
Default

Solved, problem was with IIS, needed to restart, as it was fetching old CSS, i don't know but i dont know why but IIS was sending requested file from cache.

Rupen Anjaria.:)
------------------
We CAN'T avoid problems, but can solve it.





Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS HELP:! CSS EXPANDIBLE BACKGROUND FOR TITLE phpuser2000 CSS Cascading Style Sheets 2 December 19th, 2007 12:36 AM
Rich's new CSS book: Beginning CSS 2nd Edition jminatel BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 0 June 15th, 2007 11:55 AM
What's wrong ??? FT BOOK: ASP.NET Website Programming Problem-Design-Solution 2 November 3rd, 2005 09:18 AM
Where am I going wrong ? fredb23 Classic ASP Databases 3 August 10th, 2004 04:56 AM
What's wrong?Help! amu BOOK: Beginning ASP.NET 1.0 1 October 28th, 2003 08:21 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.