Page 1 of 1

css question

Posted: Mon May 22, 2006 1:44 pm
by lewindha
Pimptastic | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hello all

I have a question regarding style sheets.

I have created a stylesheet 'general.css'.  I've included it in the php file using the <link> tag.

Now when I apply a class to say a <div> tag:

Code: Select all

<div class="header_div">
This works fine. The style is applied. But when I try to apply that same style to a div dynamically created in php, it doesn't work:

Code: Select all

<?
    echo '<div class="header_div">';
    echo 'content';
    echo '</div>';
?>
Can anyone tell me why this is happening?

Thanks


Pimptastic | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Mon May 22, 2006 2:05 pm
by lewindha
I take it back.

This works fine in Internet Explorer. But it won't in Firefox. Why is that?

Posted: Tue May 23, 2006 9:51 am
by lewindha
Can someone please help me???

Basically, Internet Explorer is applying the style to the dynamically created element and Firefox is not. Why is this? And how do I get Firefox to apply the styles?

Posted: Tue May 23, 2006 10:18 am
by jayshields
View the source of your page and post it here too. Then you might get some help :)

Posted: Tue May 23, 2006 10:20 am
by JayBird
Moved to client side

Posted: Tue May 23, 2006 10:23 am
by lewindha
Ok. It's working now, but I didn't do anything to it. But here is the code anyhow:

Code: Select all

<html>

<head>
  <link href="general.css" type="text/css" rel="stylesheet" />
</head>
<body>
<table id="page_layout_table" class="layout">
	<tr id="header_row" class="layout_header">
		<td colspan="2">
			<font size="16" color="white">AIS</font>
		</td>

	</tr>
	<tr>
		<td width="15%">
					 	<div id="admin_menu" class="menu_div">
	 					<div id="admin_header" class="menu_header">
	 					<font size="3"><b>Admin Menu</b></font>
	 					</div>
						<div class="menu_item">

						<a href="new_user.php" class="menu_item">New User</a>
						</div>
						<div class="menu_item">
						<a href="edit_user.php" class="menu_item">Edit User Info</a>
						</div>
						<div class="menu_item">
						<a href="user_permissions.php" class="menu_item">User Permissions</a>

						</div>
	 					</div>
					
		</td>
		<td>
		</td>
	</tr>
</table>
</body>
Basically all of the Div tags were dynamically created by php.