What is the best way to create text button with background image in cakephp?
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
.
精彩评论