html - DIV positioning issue when resizing web browser window -
html - DIV positioning issue when resizing web browser window -
as can see on image below , on jsfiddle http://jsfiddle.net/w2njv/, issue text won't remain aligned right of image , @ same level when cut down width of webbrowser window. moves below picture.
i don't understand why because .pt-intro-text
has width of 60% no matter size of screen me should on first image , never move below picture. help
looks ok wide width:
looks bas when resizing window (text won't stick right of picture):
http://jsfiddle.net/w2njv/
html
<div class="wrapper"> <section class="intro-personal-training clearfix"> <div class="pt-intro-header clearfix"> <h2 class="_text">nous fdfds en place un dfdsfdsfds qui vous dfds</h2> <h3 class="_text">dfsf soit votredfdsd dfds</h3> </div> <div class="intro-pic-container"></div> <div class="pt-intro-text"> <p>lorem ipsum dolor sit down amet, consectetur adipisicing elit, sed eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim advertisement minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore european union fugiat nulla pariatur. excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.. </p> <p>lorem ipsum dolor sit down amet, consectetur adipisicing elit, sed eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim advertisement minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore european union fugiat nulla pariatur. excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> </div> </section> </div>
css:
section { position: relative; } .wrapper { width: 90%; max-width: 1200px; margin-right: auto; margin-left: auto; background-color: rgb(255, 255, 255); } .intro-personal-training img { float: left; clear: both; width: 120px; margin-top: 21px; margin-left: 75.02759%; } .pt-intro-header h3 { margin-top: 3px; font-size: 26px; color: #3a7cdb; } .pt-types-de-coaching-header h3, .restons-en-contact h3 { max-width: 700px; font-size: 18px; color: rgb(45, 125, 223); } .intro-personal-training { margin-top: 70px; margin-right: auto; margin-left: auto; } .intro-pic-container { float: left; clear: both; width: 329px; height: 262px; margin-top: 59px; margin-left: 2.88%; background-image: url('http://lorempixel.com/output/fashion-q-g-329-262-5.jpg'); background-repeat: no-repeat; background-size: auto auto; background-position: center center; } .pt-intro-text { display: inline-block; float: right; width: 60%; margin-top: 59px; margin-right: 4.6671699999%; padding-left: 15px; border-left-width: 1px; border-left-color: rgb(0, 0, 0); border-left-style: dotted; text-align: justify; letter-spacing: 1px; color: #1a1a1a; } ._text { margin-right: auto; margin-left: auto; }
.pt-intro-text has width of 60%, .intro-pic-container has in little resolution more 40% , text won't remain aligned right.
put img element div , give him max width 40% (or 37% width + 3% margin).
.intro-pic-container { float: left; width: 329px; max-width:37%; height: auto; margin-top: 59px; margin-left: 2.88%; } .intro-pic-container img{ width: 100%; }
and element .pt-intro-text must have 60% width (or width + margin + padding = 60%).
if want responsive design dont utilize size (width, margin , padding) in pixels percentage.
fiddle: http://jsfiddle.net/w2njv/10/
ps: sorry bad english
html css css-float
Comments
Post a Comment