我在设计主页时遇到问题。我有一个 div,我想根据 div 内的最大内容设置宽度。这里的代码
<div class="head">
<div class="time"></div>
<div class="logo"></div>
<div class="menu">
<ul>
<li>Home</li>
<li>Profile</li>
<li>Gallery</li>
<li>Location</li>
</ul>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
和CSS:
.head{
position:relative;
width: -moz-max-content;
width: -webkit-max-content;
width: -o-max-content;
margin: 0px auto;
}
.time{
position:absolute;
width:150px;
height:50px;
left:0px;
top:10px;
}
.logo{
position: absolute;
left:0;
top:0;
margin:0px auto;
width:450px;
height: 200px;
z-index: -1;
}
.menu{
position: absolute;
width: -moz-max-content;
width: -webkit-max-content;
width: -o-max-content;
height: 25px;
text-align: center;
top: 210px;
}
Run Code Online (Sandbox Code Playgroud)
使用width: -moz-max-content,width: -webkit-max-content;并且width: -o-max-content;在 chrome、opera …
我正在尝试对必须具有不同值的2字段进行验证.我只知道如何设置验证匹配值的规则.
$this->form_validation->set_rules('book1','Book1','required|matches[book2]');
$this->form_validation->set_rules('book2','Book2','required|matches[book1]');
Run Code Online (Sandbox Code Playgroud)
如果我输入book1= novel,和book2= novel,上面的代码将返回TRUE.
如何验证每个字段的值彼此不匹配的2个字段?所以,如果我输入book1= novel和book2= comic,它将返回TRUE.