开发者

What is the best way to create text button with background image in cakephp?

开发者 https://www.devze.com 2023-03-16 16:25 出处:网络
I want to have a text o开发者_运维百科ver an image solution - any suggestions pls? I\'d like to use Html helper:

I want to have a text o开发者_运维百科ver an image solution - any suggestions pls?

I'd like to use Html helper:

$this->Html->link


a.link-bg {
    background:url(../img/nav.png) no-repeat;
    width:auto;
    display:block;
    padding:10px 15px;
    text-decoration:none;
    /*text-indent: -999em;  uncomment if you want to hide the
    text but keep it (e.g screen readers */
}

echo $this->Html->link('Link Text', array('controller'=>'foo', 
                                          'action'=>'bar'),
                                    array('title'=>'Link Text',
                                          'class'=>'link-bg')
                      ); 

Given your requirements aren't clear, this may or may not work as you intend. Essentially link takes a 3rd parameter- an array of $options such as class.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号