...

View Full Version : Can CSS Properties be defined for specific HTML elements?



jbruso
10-20-2006, 11:16 PM
I have this CSS code to add drop shaddows to tables. Normally, applying it to the code, would be easy... just surround the tables with <div> tags that are defined in the CSS... like so,



<style type="text/css">
<!--

/*core drop shadow rules*/
.wrap1, .wrap2, .wrap3 {
display:inline-table;
/* \*/display:block;/**/}
.wrap1 {
float:left;
background:url(images/shadows/v2/shadow.gif) right bottom no-repeat;}
.wrap2 {background:url(images/shadows/v2/corner_bl.gif) left bottom no-repeat;}
.wrap3 {
padding:0 8px 8px 0;
background:url(images/shadows/v2/corner_tr.gif) right top no-repeat;}
.wrap3 img {
display:block;
border:1px solid #ccc;
border-color:#efefef #ccc #ccc #efefef;}
-->
</style>

<div id="main">
<div class="wrap1">
<div class="wrap2">
<div class="wrap3">

<table><tr><td>some table</td></tr></table>

</div></div></div>
</div>

So, here's my problem... I have no control over the HTML from my "blackbox" application, only the CSS. So, I need to somehow define that these <div> tags need to be applied to all the tables on the page...

So, something like this...


<style type="text/css">
<!--

/*core drop shadow rules*/

table {.wrap1, .wrap2, .wrap3}

.wrap1, .wrap2, .wrap3 {
display:inline-table;
/* \*/display:block;/**/}
.wrap1 {
float:left;
background:url(images/shadows/v2/shadow.gif) right bottom no-repeat;}
.wrap2 {background:url(images/shadows/v2/corner_bl.gif) left bottom no-repeat;}
.wrap3 {
padding:0 8px 8px 0;
background:url(images/shadows/v2/corner_tr.gif) right top no-repeat;}
.wrap3 img {
display:block;
border:1px solid #ccc;
border-color:#efefef #ccc #ccc #efefef;}
-->
</style>

<table bgcolor="#ffffff"><tr><td>some table</td></tr></table>



Is that possible? or am I just smoking crack?

:) Thanks,

John

Arbitrator
10-21-2006, 04:28 PM
You canít write HTML with CSS.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum