Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linking to Style sheet

Status
Not open for further replies.

TheSponge

Technical User
Jul 2, 2003
442
GB
Im sure this is a simple one, but Im unsure,

I have a stylesheet called "sheet1.css"

and I have installed a referrers.php script, but it isnt formatting properly?

what is the PHP code to link to a .css style sheet please?

A+,CCNA
 
You don't link to a CSS style sheet in PHP, you link to it in HTML.
 
yeap, that's an html question...

[tt]
<link rel="stylesheet" href="/includes/forms.css">

-and in php, just echo it-

echo '<link rel="stylesheet" href="/includes/forms.css">';
[/tt]

Cheers.
 
sleipnir: sorry, but I didn't understand, what do you mean? (no offence, I speak spanish, I can understand the phrase, but not the meaning)...
 
Whereas kenrbnsn and I pointed out the question was an HTML question and did not answer it, you agreed it was an HTML question and then went on to provide an answer.

If we continue to answer non-PHP questions in this forum, people will continue to ask non-PHP questions in this forum.




Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Thanks guys, but surely this was a php question....

And below is the answer.......Thanks

-and in php, just echo it-

echo '<link rel="stylesheet" href="/includes/forms.css">';

A+,CCNA
 
This however doesnt help with a php page I have,

referrers.php, has html statements in it, but its a php page...

and I need the elements of my style sheet to be included in the php page?

ie. echo '<table><tr><td><b>referrer</b></td><td><b>hits in</b></td><td><b>hits out</b></td></tr>';

I want to put in <td class=" "> but it doesnt seem to work?

Thanks

A+,CCNA
 
Hi TheSponge,

Try escaping your quotes:
Code:
echo "<table><tr><td class=\"whatever\"><b>referrer</b></td><td><b>hits in</b></td><td><b>hits out</b></td></tr>";

Also, ensure your class is properly defined. A good way to do this is to just spit out some html code.
Code:
<?php

php code...
?>
html code here
<td class="whatever">

[cheers]
Cheers!
Laura
 
The output of a PHP script is usually a HTML page.

When you said:
Code:
echo '<table><tr><td><b>referrer</b></td><td><b>hits in</b></td><td><b>hits out</b></td></tr>';
I want to put in <td class=" "> but it doesnt seem to work?
What doesn't seem to work?

Take a look at the generated source and see if there's a HTML markup error or other error with the generated code.

Ken
 
sleipnir said:
Whereas kenrbnsn and I pointed out the question was an HTML question and did not answer it, you agreed it was an HTML question and then went on to provide an answer.

If we continue to answer non-PHP questions in this forum, people will continue to ask non-PHP questions in this forum.

hmmm... I understood. You are right, if I continue responding about HTML question (even generated by php) this forum will be a mix of several kind of forum, getting out from the objetive.

Yes, I will point out to the correct forum in the next responses.

Cheers.
 
It wouldnt show up the class style...

It does now, thank you all very much, I escaped the quotes as you suggested,

Thankyou



A+,CCNA
 
$saved.="<td><a href=\"go.php?$d->id\" title=\"in/out - $d->hitsin/$d->hitsout\" target=\"$d->id\">$url</a></td>";

This is the problem line, it will not allow me to assign a class to it?

Still not working?

Thanks

A+,CCNA
 
The line you posted does not contain the part where class is assigned to anything. I agree with sleipnir and Ken that this is purely an html question and should be asked there. As long as you understand simple string operations and printing (or echoing) out strings, you will be able to move the html solution provided to you to php pretty easy. I suggest you look at the page source (processed php code) and paste that along with your question in the html forum.
 
Vragabond

Ouch. I don't think it's what you meant.
I agree with sleipnir and Ken that this is purely an html question and should be asked there.

Anyway, HTML questions to the HTML forum please. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top