Jump to content

php include .css not working


pngtest

Recommended Posts

Hey guys i have this code

<!DOCTYPE HTML PUTLIC "-//w3c//dtd html 3.2 final//en">
<html>
<head>
<in.html";
} //end if

if (empty($links)){
   $links = "top.html";
} //end if
if (empty($content)){
   $content = "main.html";
} //end if

if (empty($links)){
   $links = "top.html";
} //end if


print "<span class = \"topMenu\"> \n";
include ("top.html");
print "</span> \n";

print "<span class = \"menuPanel\"> \n";
include ($menu);
print "</span> \n";

print "<span class = \"item\"> \n";
include ($content);
print "</span> \n";

?>
</body>
</html>

 

 

that is attached to this css

 

<style type = "text/css"
body {
  background-color: #ffffff
}

span.topMenu {
position: absolute;
left: 30%
width: 10%
}

h1{

color: #0000ff;
font-family: "Commic Sans MS";
text-align: center
}

span.menuPanel {
position: absolute;span.menuPanel {
position: absolute;
left: 15px;
width: 15%
background-color: #ccccff
}

span.item {
position: absolute;
border-bottom: small solid #000000;
margin-left: 20%;
top: 10%;
right: 15%;
width: 80%;
background-color: #ccccff;
}

                    

 

 

and i am unable to get the css working it prints the page improperly and i can not fix it everything is grouped in the left top corner

Link to comment
Share on other sites

sorry can't copy and paste properly.

 

<!DOCTYPE HTML PUTLIC "-//w3c//dtd html 3.2 final//en">
<html>
<head>



if (empty($menuPanel)){
   $menuPanel = "menu.html";
} //end if

if (empty($content)){
   $content = "main.html";
} //end if

if (empty($links)){
   $links = "top.html";
} //end if


print "<span class = \"topMenu\"> \n";
include ("top.html");
print "</span> \n";

print "<span class = \"menuPanel\"> \n";
include ($menu);
print "</span> \n";

print "<span class = \"item\"> \n";
include ($content);
print "</span> \n";

?>
</body>
</html>

 

that should be corrected.

Link to comment
Share on other sites

thanks for all of your guys help and sorry about the wierd things don't know what happened.....

ok it is still not working and i still don't know why.Here is the php code.

<html>
<head><title></title>
<body>

<?php

include ("pngstyle.css");

if (empty($linkMenu)){
   $linkMenu = "menu.html";
}// end if

if (empty($topMenu)){
   $topMenu = "navigation.html";
} //end if

if (empty($mainMenu)){
   $mainMenu = "main.html";
} //end if


print "<span class = \" linkMenu\"> \n";
include ($linkMenu);
print "</span> \n";


print "<span class = \" topMenu\"> \n";
include ($topMenu);
print "</span> \n";

print "<span class = \"mainMenu\"> \n";
include ($mainMenu);
print "</span>";

?>

</body>
<html>

 

and the css

 

<style  type = "text/ccss">

body {
   background-color: red;
}

span.linkMenu {
   position: absolute;
   left: 1%;
   width: 20%;
   background-color: #fffff2;
}

span.topMenu {
   position: absolute;
   top: 2%;
   width: 80%
   background-color: #fffff2;
}

span.mainMenu {
   position: absolute;
   top: 6%;
   width: 80%;
}

A:link {font-color: #000000}
A:hover {font-size: 10%}
A:visited {font-color: #0000ff}

</style>

 

and what the source come to when you view.

 

<html>
<head><title></title>
<body>

<style  type = "text/ccss">

body {
   background-color: red;
}

span.linkMenu {
   position: absolute;
   left: 1%;
   width: 20%;
   background-color: #fffff2;
}

span.topMenu {
   position: absolute;
   top: 2%;
   width: 80%
   background-color: #fffff2;
}

span.mainMenu {
   position: absolute;
   top: 6%;
   width: 80%;
}

A:link {font-color: #000000}
A:hover {font-size: 10%}
A:visited {font-color: #0000ff}

</style>
<span class = " linkMenu"> 


<ul>
   <li><a href = "page.php?content=main.html">
      main</a>
   </li>
</ul>


</span> 
<span class = " topMenu"> 
link one
</span> 
<span class = "mainMenu"> 
this should be content in the main body of the page
</span>
</body>
<html>

 

am i doing something wrong

Link to comment
Share on other sites

You need to put the open body tag after your php so that the style block isn't in the body. You also need to close the head tag before your php. After that, you need to remove the extra 'c' in "text/ccss". After those three things, your style block should actually get parsed, I don't know if it is how you want it to look, though.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.