IBM developerWorks
           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 July 10th, 2001, 03:44 AM
NZ Joe NZ Joe is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Location: Kapiti, New Zealand
Posts: 36 NZ Joe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
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:
<span class="smallcart">
<?
php
if ($action != "edititem") {
$action="";                
include (
'displaysmallcart.php');
}
include (
'randombook.php');
?>
</span> 


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

Reply With Quote
  #2  
Old July 10th, 2001, 03:56 AM
andnaess andnaess is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Jul 2001
Location: Oslo
Posts: 1,516 andnaess User rank is Private First Class (20 - 50 Reputation Level)andnaess User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
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.

Reply With Quote
  #3  
Old July 10th, 2001, 04:16 AM
NZ Joe NZ Joe is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Location: Kapiti, New Zealand
Posts: 36 NZ Joe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
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

Reply With Quote
  #4  
Old July 10th, 2001, 04:35 AM
andnaess andnaess is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Jul 2001
Location: Oslo
Posts: 1,516 andnaess User rank is Private First Class (20 - 50 Reputation Level)andnaess User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
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;
}

Reply With Quote
  #5  
Old July 10th, 2001, 04:51 AM
NZ Joe NZ Joe is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Location: Kapiti, New Zealand
Posts: 36 NZ Joe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Fantastic!!! Thanks very much. It works perfectly

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > CSS not applied to include


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


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





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