views:

99

answers:

2

Can anybody explain to me why this won't work on CodeIgniter?

.linkBack{
   background-image:url('/myBlog/CodeIgniter_1.7.2/pictures/arrow.gif');
 display:block;
 height:58px;
 width:105px;
 text-indent:-999px;
}  

<div class="linkBack"><?=anchor('myBlog', 'Back to Blog');?></div>

while this would work perfectly:

#linkBack {
 background-image:url(/myBlog/CodeIgniter_1.7.2/pictures/arrow.gif);
 position:fixed;
 left:10px;
        bottom:10px;
 display:block;
 height:58px;
 text-indent:-9999px;
 width:100px;
}

<a href="/myBlog/CodeIgniter_1.7.2/index.php/myBlog"  id="linkBack">Back to Blog</a>

it is an image used as a link...

A: 

With the url helper loaded either via the contoller ($this->load->helper('url');) or via the helper array in /system/application/config/autoload.php; try:

anchor('myBlog',img(array('src'=>'/myBlog/CodeIgniter_1.7.2/pictures/arrow.gif','border'=>'0','alt'=>'My Blog')));
stormdrain
thanks for the reply...I'm trying it but it doesn't present the picture anywhere on my browser and there is no link to anywhere...also there is no error
rabidmachine9
1: are you loading the url helper either in the controller or via the helper array in autoload.php? 2: if you view the source of the page, does anything show up?
stormdrain
A: 

It may be something as simple as being more specific in your CSS selector (e.g. a#linkback).

Vernon