我ul
在水平视图中有一个树列表项.所有列表项都具有相同的背景图像:
我想重叠背景图像,所以它看起来像这样:
这是我的jsFiddle
CSS:
div#menu ul li{
height:30px;
display: inline;
list-style-type: none;
width: 60px;
background: url(http://i.stack.imgur.com/adwVj.jpg);
background-size: 100%;
background-repeat: no-repeat;
padding-right: 5px;
padding-left:30px;
z-index:2;
}
div#menu ul li:first-child{
padding-left:20px;
z-index:3;
}
div#menu ul li:last-child{
padding-left:35px;
margin-left:-30px
z-index:1;
}
Run Code Online (Sandbox Code Playgroud)
HTML:
<div id="menu">
<ul>
<li>Account</li>
<li>Registreren</li>
<li>Winkelwagen</li>
</ul>
</div>
Run Code Online (Sandbox Code Playgroud)
z-index出错了!
在我的控制器中,我有一个我想在我的视图中使用的公共变量.
public $header = array("show_menu"=>true);
Run Code Online (Sandbox Code Playgroud)
传统我会将变量作为数组传递给load->view("incl_header",$header)
函数,但是我注意到在我的视图中我可以检索我的控制器的变量,如下所示:
echo $this->header['show_menu'];
Run Code Online (Sandbox Code Playgroud)
在我的视图文件中检索这样的变量有什么问题吗?
我正在使用codeigniter 2.1.3
我在CodeIgniter中有一个名为"someclass"的库.
class someclass extends CI_Controller {
function __construct() {
parent::__construct();
$this->load->helper('url');
$this->load->helper('form');
$this->load->library('email');
$this->load->database();
// $this->load-> library('database');
}
function email($naar=0,$onderwerp=0,$bericht=0){
if ($naar > 0 && $naar<10) {
$to = "tester@test.com"
//this is the part where it goes wrong
$CI =& get_instance();
$this->load->library('email');
//some one said that i needed ti assign the library's
$this->_assign_libraries();
$this->email->from('tester@test.com', 'test');
$this->email->to($to);
$this->email->subject($onderwerp);
$this->email->message("Test
bericht :
".$bericht);
$this->email->send();
// echo $this->email-> print_debugger();
}
}
}
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
A PHP Error was encountered
Severity: Notice
Message: Undefined property: …
Run Code Online (Sandbox Code Playgroud)