English 中文(简体)
是否有办法使“灰复燃”的灰 gr灭?
原标题:Is there a way to have divs "greedily" grab width?
  • 时间:2012-05-07 18:24:29
  •  标签:
  • css

我有两点 by子。 他们都穿着 j。 当这两种情况都看得见时,他们都有固定的宽度,但当一个人被关闭时,我希望剩余的干.能够扩大,吃上封闭的干.。 是否有办法只使用特别安全局(距离近海州以外)来做到这一点,或者我是否不得不采用 j法?

最佳回答

我能够看到与安保部共同解决这一问题的唯一方法是在包含要素的课堂上添加:

<div id="container" class="left|right|both">
    <div class="left"></div>
    <div class="right"></div>
</div>

Style the contents depending on what the parent class is. If left is the class, you give the first div a non-restricted width and hide the second div. The same goes for right and the second div. When the parent is both, you give both divs 50%.

所有的 Java本都需要处理目前适用于集装箱的那类。

问题回答

你们需要为此撰写一行 j字,然后可以为此使用 c。

每当你点尾时,用 j子把一等 class子引向四分之母。 为点击 close尾 but而制定jquery代码,并添加

$("#parent").toggle("classname");

类似用途

#parent div { width: /*fixed*/100px; }
#parent.classname div { width: 100%; }

是否像这项工作一样?

传真:

<div id="parent">
    <div class="right">div2</div>
    <div class="left">Lorem  ipsum dolor sit amet, consectetur adipiscing elit. Nullam semper porta  sem, at ultrices ante interdum at. Donec condimentum euismod consequat.  Ut viverra lorem pretium nisi malesuada a vehicula urna aliquet. Proin  at ante nec neque commodo bibendum. Cras bibendum egestas lacus, nec  ullamcorper augue varius eget.</div>
</div>
<br />
<button id="remove">Remove Div 2</button>

CSS:

#parent {
    overflow: hidden;
    border: 1px solid red
}
.right {
    float: right;
    width: 100px;
    height: 100px;
    background:green;
}
.left {
    overflow: hidden;
    height: 100px;
    background:red;
}​
​

JS:

$( #remove ).on( click , function() {
    var div2 = $( .right )
    //div2.hide( slow );  // you could hide it as well  
    div2.remove();
});​

例:

<><><>>><>>>><>>><>>>>>

你们可以通过使用模版表进行 mi调。

display:table

以及

display:table-cell

See: http://jsfiddle.net/DUx3W/ (hat tip: @Jimmy Breck-McKye).

My original table fiddle:





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

Drop down background url in Safari Issue

selectBox.selectCSS { background: url(/Images/replacementSelectBackground.png) top left no-repeat height:auto; } I have an issue in Safari only where the image is not rendering on top ...

CSS specific for Safari

How do you target specifically safari in css with styles?

Aligning textarea in a form

Ive used the following css code to align my form elements: form { position:relative; } form input { position:absolute; left:11em; } However, the textarea element is not aligned correctly with the ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

CSS problem with page footer

I have defined my page footer in the css file as: #footer { position: absolute; height: 50px; text-align: center; background: #66CCCC; bottom: 0px; left: 0px; width: 100%; height: ...

热门标签