如何让2个浮动div具有相同的高度(How to have 2 floating divs have the same height)
我有一个包含内包装的包装器,内包装器包含2个浮动div。 左边的内容比右边的内容多,所以它的高度大于右边的高度。 我要找的是两个容器都有相同的高度。
我的HTML:
<div id="wrapper"> <div id="sub-menu"> <div id="left-column" class="column"> Agenda</br> Here I put some texte </div> <div id="right-column" class="column"> sdfdsf </div> </div> </div>
我的css:
body{ background-color:#E5E5E5;} #wrapper{ background-color:#FFFFFF; width:800px; margin-left:auto; margin-right:auto; overflow:auto;} #sub-menu{ margin:10px; width:780px; position:relative; float:left;} .column{ float:left; height:100%;} #left-column{ width:500px; background-color:yellow;} #right-column{ width:280px; background-color:magenta;}
I have a wrapper containing an inner wrapper, and that inner wrapper contains 2 floating divs. The left one contains more content than the right one, so it's height is greater than the one on the right. What I am looking for is that both of the containers would have the same height.
My html:
<div id="wrapper"> <div id="sub-menu"> <div id="left-column" class="column"> Agenda</br> Here I put some texte </div> <div id="right-column" class="column"> sdfdsf </div> </div> </div>
My css:
body{ background-color:#E5E5E5;} #wrapper{ background-color:#FFFFFF; width:800px; margin-left:auto; margin-right:auto; overflow:auto;} #sub-menu{ margin:10px; width:780px; position:relative; float:left;} .column{ float:left; height:100%;} #left-column{ width:500px; background-color:yellow;} #right-column{ width:280px; background-color:magenta;}
原文:https://stackoverflow.com/questions/9648007
最满意答案
你错过了在你的函数上传递
$entityManager
。请添加名称空间
model/dao;
在你的Canales.php
You missed to pass
$entityManager
on your function.And please add namespace
model/dao;
in yourCanales.php
相关问答
更多-
查询+ Doctrine(Where query + Doctrine)[2022-11-04]
尝试: $query = $repository->createQueryBuilder('a') ->join('a.item', 'i') ->where('i.ItemApproved is not NULL') ->getQuery(); try: $query = $repository->createQueryBuilder('a') ->join('a.item', 'i') ->where('i.ItemApproved is not NULL') ->getQuery(); -
我认为应该是 arguments: [ "@doctrine.orm.entity_manager" ] 在你的Service.yml中 I think it should be arguments: [ "@doctrine.orm.entity_manager" ] in your Service.yml
-
EntityManager已关闭(The EntityManager is closed)[2022-06-24]
这是一个非常棘手的问题,因为至少对于Symfony 2.0和Doctrine 2.1,在关闭后不可能重新打开EntityManager。 我发现克服这个问题的唯一方法是创建自己的DBAL Connection类,包装Doctrine一个并提供异常处理(例如重试几次,然后将异常弹出到EntityManager)。 这有点恶作剧,我恐怕会在事务环境中造成一些不一致(即我不太确定如果失败的查询在事务中间会发生什么情况)。 以这种方式进行的示例配置是: doctrine: dbal: default_c ... -
DateTime毕竟是对象,并且总是通过引用传递。 所以,我强烈建议你像这样编辑你的代码: $period = $payment->getDetail('period'); $validDate = clone $subscription->getPaymentValidUntil(); $validDate->add(new \DateInterval($period == Subscription::MONTH ? 'P1M' : 'P1Y')); $subscription->setPaymentVa ...
-
它受SQL注入的保护。 您可以找到源代码来查找它,相关代码位于Doctrine\ORM\Persisters -namespace,以及Doctrine\ORM\EntityRepository和Doctrine\ORM\UnitOfWork 。 您的标准将转换为占位符,这也是编写自己的查询以防止SQL注入的推荐方法。 It is secured from SQL-injection. You can find look at the source to find this out, the relevan ...
-
你错过了在你的函数上传递$entityManager 。 请添加名称空间model/dao; 在你的Canales.php You missed to pass $entityManager on your function. And please add namespace model/dao; in your Canales.php
-
好的,解决了! 我只需要将EntityManager传递给控制器中Registration类的构造函数。 use Symfony\Component\Validator\Constraints as Assert; use Acme\UserBundle\Entity\User; class Registration { /** * @Assert\Type(type="Acme\UserBundle\Entity\User") */ protected $user; ...
-
您要求学说在数据库中找到这些标准。 在你的情况下,它返回null但如果数据库中有这样的用户firstName = 'Michael' AND lastName = 'Jordan'它也可以返回一条记录。 此query的结果与您新创建的用户无关。 如果它将从EntityManager返回用户,那么您将无法知道它是来自数据库还是来自内存。 You are asking doctrine to findOneBy those criteria inside the database. In your case i ...
-
doctrine2中的逻辑OR getRepository-> findBy()(Logical OR in doctrine2 getRepository->findBy())[2022-05-14]
尝试这个 $em->getRepository('myentitity') ->findBy( array('field' =>array( 'value1','value2')) // $where ); 如果传递一个值数组,Doctrine会自动将查询转换为WHERE字段IN(..)查询: try this $em->getRepository('myentitity') ->findBy( ... -
您需要将名称空间类传递给getRepository方法。 尝试: $tabRepository = $entityManager->getRepository('Tnq\\Todo\\Model\\Tab'); You need to pass the namespaced class to the getRepository method. Try: $tabRepository = $entityManager->getRepository('Tnq\\Todo\\Model\\Tab');