Welcome Guest, Not a member yet? Register   Sign In
css in code ignitor
#1

[eluser]mohfeza code ignitor[/eluser]
I am new at code ignitor. Could you please let me know how data can be received from css file to "view". I created a folder called 'css' in system root. Then I created a file in css folder named "testcss.css".
In controller I called
$data['cssContent'] = '<link rel="stylesheet" type="text/css" href=="' . $this->config->item("base_url") . 'css/testcss.css" />';


please let me what i have to do in view file to get data from "testcss.css".
#2

[eluser]Kemik[/eluser]
Wrong forum but don't worry.

Just do
Code:
echo $cssContent;
in the <head> section of your view file.
If the css link is the same in every file you could put it in your header view or use $cssContent for just the stylesheet name. That would save you having to type that long line every time you want to add a stylesheet.
#3

[eluser]mohfeza code ignitor[/eluser]
I did echo $cssContent; in head

In body I use
<div><font size="+1" class="textcolor"> this is a text</font></div>

but it is not working.

please let me know if there is any particular syntax to get it work.
#4

[eluser]wiredesignz[/eluser]
Your HTML is malformed, also creating HTML in a Controller is not recommended.
Code:
$data['cssContent'] =
'&lt;link rel="stylesheet" type="text/css" href=”'.base_url().'css/testcss.css” /&gt;';




Theme © iAndrew 2016 - Forum software by © MyBB