 |
| 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
|
|
|
|

August 25th, 2005, 11:24 AM
|
|
Registered User
|
|
Join Date: Apr 2005
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
|
|
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.
|
|

August 25th, 2005, 11:32 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
|
|
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
|
|

August 25th, 2005, 08:52 PM
|
|
Registered User
|
|
Join Date: Apr 2005
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
|
|
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.
|
|

August 26th, 2005, 08:04 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
|
|
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
|
|

August 30th, 2005, 07:48 PM
|
|
Authorized User
|
|
Join Date: Aug 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
what was the exact validation error and what is the html that you are applying this style sheet to?
|
|

August 30th, 2005, 07:57 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 425
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
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<
//\ =^..^=
|
|

August 31st, 2005, 03:30 AM
|
|
Registered User
|
|
Join Date: Apr 2005
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
|
|
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.
|
|
 |