Forum Moderators: not2easy

Message Too Old, No Replies

Index.php page not taking external css code

         

plasmagames

8:54 pm on Mar 2, 2009 (gmt 0)

10+ Year Member



I am having a problem with my site. as you read in my topic title the index page isn't taking external css commands.

heres my index.php page.

---------------PHP----------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>title</title>
<link href="psgs.css" rel="stylesheet" type="text/css">
</head>
<body background="images/bg.png" text="#FFFFFF" link="#CCCCCC">
<div class="site" align="center">
<center>
<div align="center" class="main" style="width:900; height:auto; background-repeat:repeat;">
<div class="navbar" align="left">
<?php include ('navbar.php'); ?>
</div>
<div align="right"class="logo" style="width:600; height:auto">
<img src="images/logo.png" alt"alt text" />
</div>
<div align="left" class="userpanel" style="width:300; height:auto;">
Navigation
</div>
</div>
</center>
</div>
</body>
</html>
---------------PHP-----------------

and heres my css

---------------CSS-----------------
site {
background-image:url(/images/sitebg.png);
width:auto;
height:auto;s
}
main {
background-image:url(/images/bg.png);
width:900;
height:auto;
background-repeat:repeat;

}

navbar {
background-image:url(/images/navbg.png);
width:900;
height:40;
}
---------------CSS-----------------

if you want to see what i'm talking about then go here.

<snip>

[edited by: swa66 at 9:58 pm (utc) on Mar. 2, 2009]
[edit reason] removed specifics, and NO personal links, see ToS [/edit]

plasmagames

9:23 pm on Mar 2, 2009 (gmt 0)

10+ Year Member



i will also add that it's not putting the background images in the divs either

g1smd

9:28 pm on Mar 2, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



*** href="psgs.css" ***

Change this to have a leading / and the full path to the file.

href="[b]/[/b]psgs.css"
OR
href="[b]/styles/[/b]psgs.css"

sonjay

9:31 pm on Mar 2, 2009 (gmt 0)

10+ Year Member



You should go ahead and remove your URL before the mods do it for you. No URLs allowed here.

That said, your css file isn't set up correctly. For site, main, and navbar, you need .site, .main, and .navbar.

Your navbg.png and sitebg.png files are not located at /images/navbg.png and /images/sitebg.png -- either you haven't uploaded them, or you've coded the paths wrong to their actual location.

choster

9:39 pm on Mar 2, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your class selectors are missing periods-- "site" would apply styles to <site>, whereas ".site" would apply them to <div class="site"> or what have you.

Your code contains other errors which may also cause unexpected behavior in different browsers. For instance, you must specify units for numerical measurements, e.g. "900px" not "900." You have a stray "s" in the style for site, and in the markup your <link> should be closed (<link ... />). Are you sure you need/want to use XHTML here? If so, why the <center> elements and align attributes?

oluoch28394

5:45 pm on Mar 3, 2009 (gmt 0)

10+ Year Member



As a side note for future reference, if you had used the id attribute, eg. <div id="site"> you would use #site in your css to apply styles.