Skip to main content
Inspiring
April 6, 2007
Question

layout.css

  • April 6, 2007
  • 5 replies
  • 498 views
hey guys, i am having a major problem getting my layout to work on a script, i uploaded the file to "includes" and made sure is here:

LINE 19 - <title><?php echo $page_title; ?></title>
LINE 20 - <style type="text/css" media="screen">@import "./includes/layout.css";</style>
LINE 21 - </head>

But still doesn't work, here is the page :
http://therainbowpride.com/myphp2/index.php
If someone can help me getting this to work i would be very thankfull, thank you.

WARNING :::: do NOT go to my website, it is an adult website and i don't want to upset nobody.
Thank you
This topic has been closed for replies.

5 replies

Inspiring
April 7, 2007
yes, i have that book , just got it last week along with php solution, but i am finishing the larry ullman's book first before i start another.
so, the link i sent , can i learn the basic from it, before i start the book ?
i just want to fix the chapter 13 by adding a layout to it so that way i don't feel like i cheated.
Inspiring
April 7, 2007
If you are using Dreamweaver, you might want to get David Power's book, PHP for Dreamweaver 8. It's pretty good.
Inspiring
April 7, 2007
i found this website http://www.subcide.com/tutorials/csslayout/page2.aspx maybe if i follow this steps i will be able to understand more and learn enough to get me going, what do you think?

thank you
Inspiring
April 7, 2007
I am just learning php, but I have been using css to design web sites for a while. So, for what's it worth (and since no one else has responded yet), here's my advice:

What you need to do is to create a php page and link it to a stylesheet. Let's say your styles are listed in a css file named "mainstyles" and in a folder named "styles." You can either link it to your php file:

<link href="styles/mainstyles.css" rel="stylesheet" type="text/css" media="screen" />

or import it:

<style type="text/css" media="screen">
@import url("styles/mainstyles.css");
</style>

That's all you need, except it's a good idea to include the following code to compensate for IE5's rendering of css (just add it beneath the linked or imported stylesheet code):

<!--[if IE 5]>
<style>
body {text-align: center;}
#wrapper {text-align: left;}
#nav a {width: 146px;}
</style>
<![endif]-->

Now, name your file something like mainstyles.php.

Now, add the following code to your php pages that you want styled with the mainstyles:


<?php
include('folder/mainstyles.php');
?>

Of course, replace the word "folder" with the name of the folder that contains this file. You would write this code in the head section.

You tried to use html style tags to import your php file. You need to remember that anything between php tags (<?php ?>) will be interpreted by the web browser as php code. Any thing outside those tags will be interpreted as html.
Inspiring
April 7, 2007
Thank you MValentine for the reply, comes to find out that the layout given in this chapter'13' has nothing to do with the script from the book itself" i think larry ullman should think of other with less experience in css"
I need to learn how to create layout to fit my pages'script'. At least the basic. Is it that diff to create layouts??

This i the page: http://therainbowpride.com/myphp2/index.php
as you can see the layout did work
Inspiring
April 6, 2007
this is the name of the scripts that work all together:

config.inc.php
index.php
mysql_connect.php
layout.css
header.html
footer,html

i checked all one by one many many times, ans tested one by one separately.
I dont understand why doesn't the layout.css work in it.