|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
CSS not applied to include
I've got a problem with a css class that does not display correctly for one include file.
PHP Code:
The problem is that displaysmallcart.php does not have the formatting described in the smallcart class of the css but randombook.php does. displaysmallcart doesn't have any formatting in it other than table tags.
__________________
Gravity always wins |
|
#2
|
|||
|
|||
|
Your problem is certainly not a PHP problem, but rather related to your CSS or the contents of displaysmallcart.php.
Try being more specific for example by posting the CSS that isn't being applied, and the HTML to which it should be applied. |
|
#3
|
|||
|
|||
|
CSS:
.smallcart{ background-color: transparent; font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; font-size : xx-small; text-decoration : none; } displaysmallcart.php: <?php mysql_connect ($dbhost, $dbuser, $dbpass) or die("Could not Connect"); mysql_select_db ("testss"); $query = "select * from carttable where sessid = '$s'"; $result = mysql_query ($query) or die ("Could not execute query"); print '<table>'; while ($query_data = mysql_fetch_array($result)) { echo "<tr><td>",$query_data[product],"</td><td>",$query_data[fabric],"</td><td>",$query_data[size], "</td><td>"; ?> <form method="post" action="edititem.php?s=<?php echo $s?>&action=<?php echo $action?>"> <input type="hidden" name="itemno" value ="<?php echo $query_data[id]?>"</input> <input type="image" border="0" name="submit" src="images/delete.gif"></input> </form></td></tr> <?php } print '</table>'; ?> HTML source generated: <span class="smallcart"> <table><tr><td>tights</td><td>Camel</td><td>1 Year</td><td> <form method="post" action="edititem.php?action="> <input type="hidden" name="itemno" value ="8"</input> <input type="image" border="0" name="submit" src="images/delete.gif"></input> </form></td></tr> </table>Test to see that randombook.php is included (text only file at this stage)</span> The table generated by displaysmallcart.php is not formatted with the smallcart class, but with the default format. randombook.php is formatted correctly by smallcart class |
|
#4
|
|||
|
|||
|
Ah, I guess you're using IE to display the page. One thing to remember about CSS is that the current implementations are buggy, so when using CSS, always make sure to keep a good buglist under your pillow.
As for this particular error; IE doesn't apply inheritance correctly for tables, so tables won't inherit the style set for body or any other wrapping element. The simplest workaround is to create a style definition for the table aswell: .smallcart table { background-color: transparent; font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; font-size : xx-small; text-decoration : none; } |
|
#5
|
|||
|
|||
Fantastic!!! Thanks very much. It works perfectly![]() |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > CSS not applied to include |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|