html - CSS Div Alignment and Positioning -


i'm trying create page similar this: http://bit.ly/1t8xgqp specifically, i'm talking row guy in kitchen.

as envisage it, row consists of text container , image container encapsulated within row container.

when window made smaller,the image appears move behind text column.

when window made larger, text column sticks side of image column. image column sticks right side of screen @ times.

i have been unable create this.

here code:

html

<div id="row_container">      <div id="image_container">     <img src="images/1297x756_image.jpg" width="1297px" height="756px" border="0" />     </div>      <div id="text_container">     text     </div>  </div> 

css

#row_container {     width: 100% height: 756px; background-color:black; position:relative; }  #image_container{ width: 1297px; height: 756px; background-color:#03c; position:absolute; right: 0; }  #text_container { width:  383px; height: 756px; background-color:blue; position:absolute; left:0px; } 

can please me fix this? thank you!!!

you should float image , text , avoid using position:absolute.

css

#row_container {   width: 100%;   height: 756px;   background-color:black;   float:right;   background-color:#03c;   position:relative; } #image_container{   width: 912px;   height: 756px;   background-color:#03c;   float:right;   right: 0; } #text_container {   width:   383px;   height: 756px;   background-color:blue;   float:left;   left:0px; } 

html

<div id="row_container"> <div id="image_container"> <img src="http://www.planwallpaper.com/static/images/a601cb579cc9a289bc51cd41d8bcf478_large.jpg" width="100%" height="756px" border="0" /> </div> <div id="text_container">     <p>lorem ipsum dolor sit amet, consectetur adipiscing elit. proin sodales convallis bibendum. donec ac elit id diam egestas ultricies. curabitur porttitor nulla in odio porttitor congue. ut eu magna justo. etiam consectetur rutrum porttitor. nullam tempus sodales volutpat. sed interdum imperdiet tellus, id semper turpis facilisis vel. curabitur sed ipsum nec nisl hendrerit viverra in ut felis.</p> </div> 

do come if still face issue.


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -