css - Aligning two divs? -


bit of css newb here. i'm using fluid grid layout in dreamweaver cs6. created headercontainer div, headerleft , headerright divs inside it. i've added image headerleft , typed text in headerright. want able have text remain in line center of image no regardless of resizing fluid layout.

what's best way this? put 2 headers in container div hoping make easy me align 2 divs within container, i'm not sure how achieve it. here's code have section of page:

edit: code says (but still doesn't work):

.gridcontainer {     margin-left: auto;     margin-right: auto;     width: 90.5666%;     padding-left: 0.2166%;     padding-right: 0.2166%; } #headercontainer {     clear: both;     float: left;     margin-left: 0;     width: 100%;     display: block;     font-family: arial, helvetica, sans-serif;     color: #fff;     text-align: left; } #headerleft {     clear: both;     float: left;     margin-left: 0;     width: 49.7607%; } #headerright {     clear: none;     margin-left: 0.4784%;     width: 49.7607%;         } 

and html says:

<div class="gridcontainer clearfix">   <div id="headercontainer">     <div id="headerright">       <h2>support gadgets &amp; tech!</h2>     </div>     <div id="headerleft"><h2><img src="images/logo2.png" alt="alt" longdesc="desc"></h2>     </div>   </div> 

thanks lot!

remove display:block; #headerleft , #headerright

also, can set float:left; on headerleft id, , put div headerright before left 1 in html code.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -