xHTML/CSS: How to make inner div get 100% width minus another div width -


I have two nested divisions in the outer one, in which the width is: 100% both nested devices should be in one line and First of all it should be with its contents:

   

The question is how to get the # 2 internal horizontal position to the left if the #internet 1 div is not specified, and it depends on what it is inside ?

PS In my case, there are different classes in all styles, here I put CSS in style characteristics for simplification.

I should work in IE7 + and FF 3.6

More information for me looks like this:

  & lt; Style type = "text / css" & gt; .captionText {float: left; } .captionLine {height: 1px; Background color: black; Margin: 0 px; Margin-left: 5px; Margin-top: 5px; Border: 0 pixels; Padding: 0 pixels; Padding-top: 1px; } & Lt; / Style & gt; & Lt; Table style = "width: 300px;" & Gt; & Lt; Caption width = "100%" & gt; & Lt; Div class = "captiontext" & gt; Some text & lt; / Div & gt; & Lt; Div class = "caption line" & gt; & Lt; / Div & gt; & Lt; / Heading & gt; & Lt; TR & gt; & Lt; TD & gt; Some & lt; / TD & gt; & Lt; / TR & gt; & Lt; / Table & gt;  

The image I want is: What do I want to image

mysterious overflow: hidden; Your friend is here to prevent the imminent elements of the floats located behind the float - I think it is the layout you are looking for.

A little bit of HTML has been edited here: I do not think you have the # character in your id s:

  

And you want CSS to get the layout that you want.

(I put HTML in the additional CSS for IE 6. I saw that you did not really need it, it is also meant to work in IE 6, but if you have IE 6 users Looking good ...)

  & lt; Style type = "text / css" & gt; #outer {overflow: hidden; / * Creates its early children in #outer * / width: 100%; / * Colors and borders / limitations for illustration purposes: Solid 3px # 666; Background: #ddd; } #inner 1 {float: left; / * Make this device as broad as your content * / / * Colors and Limits for the purpose: / range: Solid 3px # c00; Background: #fdd; } #inner2 {overflow: hidden; / * The rest take horizontal space to this divisive, and not * / / * colors and boundaries for illustration purposes * / boundary: solid 3px # 00c; Background: #DDF; } & Lt; / Style & gt; & Lt ;! - [If lte IE 6] & gt; & Lt; Style type = "text / css" & gt; #inner2 {zoom: 1; / * Take this div to the rest of the horizontal space, and no more, IE 6 * /} # inner1 {margin-right: -3px; / * Fix 3-Pixel Difference The introduction of the previous rule (This is the way that web developers hate IE 6.) * Lt; / Style & gt; & Lt; [Endif] - & gt;  

Testing and working in I, 6, 7 and 8; Firefox 3.5; And chrome 4.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -