-1

Hello guys i need help i am trying to include base_url inside background url in a css file but it is not working please i need help in this.

  background: url('<?php echo base_url();?>assets/images/re_1.png') repeat;
color: #413c35;
-webkit-font-smoothing: antialiased;
overflow-x: hidden;
user3551487
  • 162
  • 2
  • 3
  • 15

3 Answers3

1

try this:

body {
 background:#356aa0 url(../img/background.png) repeat-x;
 color:#fff;
}

And now call it:

<link rel="stylesheet" type="text/css" href="<?=base_url()?>css/style.css"/>
Sumanta736
  • 695
  • 3
  • 10
0

try this

css

background:url('assets/images/re_1.png');
color: #413c35;
-webkit-font-smoothing: antialiased;
overflow-x: hidden;

html

 <link rel="stylesheet" href="<?php echo base_url('example.css');?>">

example.css change to your css file path

naseeba c
  • 1,040
  • 2
  • 14
  • 30
0

write css at your view

<style>
.blah{ 
   background: url('<?php echo base_url();?>assets/images/re_1.png') repeat;
  color: #413c35;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  }
</style>
alidjator
  • 1
  • 2