How to include css in html using php -


i'm including css using php

<?php include "css/cssnew.css"; ?> 

but font awesome not working, icons showing squares

css:

@font-face {     font-family: fontawesome;     src: url(/css/fonts/fontawesome-webfont);     font-weight: 400;     font-style: normal }  .fa {     display: inline-block;     font: normal normal normal 14px/1 fontawesome;     font-size: inherit;     text-rendering: auto;     -webkit-font-smoothing: antialiased;     -moz-osx-font-smoothing: grayscale }  .fa-angle-double-up:before {     content: '\f102'; } 

can please tell me why fa-angle-double-up:before not showing

        content: '\f102'; 

i know, there 3 method adding css html , echo php:

  1. use link:

<?php echo '<link rel="stylesheet" type="text/css" href="style.css" media="screen" />';

in method, can add css codes in css file style.css , echo html <link> php.

  1. embedding css html:

<?php echo '<style media="screen" type="text/css">add style rules here</style>'; ?>

example:

<?php echo '<style media="screen" type="text/css">@font-face{font-family:fontawesome;src:url(/css/fonts/fontawesome-webfont);font-weight:400;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 fontawesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-angle-double-up:before{content:"\f102"}</style>'; ?> 
  1. last method:

<style><?php include "css/cssnew.css"; ?></style>

or

<?php  echo '<style>';  include "css/cssnew.css";  echo '</style>' ;?> 

Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -