Jump to content

style


karimali831

Recommended Posts

Hello

 

Sorry if I can't explain this properly, I'll give it a try..

 

I add some style in index.php:

 

<style>

....

</style>

 

I use links such as:

 

index.php?page=news

index.php?page=articles

 

etc.

 

Now I only want to use the style in news, articles but not index.php itself if that makes sense?

I can add the style in news, articles files itself but the style will be affected in index.php which I don't want.

 

 

Link to comment
Share on other sites

you can do something like this:

 

<?php
// list of pages where you WANT <style> to show:
$listOfPages = array("news","articles");
if(in_array($_GET['page'],$listOfPages)){
?>
<style>
....
</style>
<?php
}
?>

 

but it's better to have your css in external files.

Link to comment
Share on other sites

I have tried this but the style affects index.php still  :shrug:

 

<?php
$listOfPages = array("news","articles");
if(in_array($_GET['site'],$listOfPages)){
?>
<style>
tr, td, table
{
padding:4px;
border-collapse:separate;
border-spacing:1px 1px;
border-color:#000000;
}
</style>
<?php
}
?>

 

index.php?site=articles

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.