2012-01-25 1 views
2

Je suis un peu rouillé avec css et je suis coincé là-dessus, ce que j'essaie de faire est d'avoir deux div côte à côte avec une image chevauchant les deux coins supérieurs, ce que j'ai fait beaucoup (je l'espère à juste titre), ce que je fais coincé tente de centrer les deux divs côte à côte que je ne peux pas le faire actuellement sans le casserCentrer un div deux côte à côte

toute aide serait super, Merci

<style> 
#wrapper { 
    margin:0 auto; 
    height:auto; 
    overflow: hidden; /* add this to contain floated children */ 
} 
#first { 
    width: 300px; 
    float:left; /* add this */ 
    color:#FFF; 
    padding:0 5px 5px 5px; 
    background: url(view.image?id=598) 0 100% #fcb033 no-repeat; 
} 
#second { 
    width: 300px; 
    float: left; 
    padding:0 5px 5px 5px; 
    color:#FFF; 
    background: url(view.image?id=595) 100% 100% #c1d72e no-repeat; 

} 
    #overlayleft{ 
     position:absolute; 
     top:-40px; 
     left:-30px; 
    } 

    #overlayright{ 
     position:absolute; 
     top:-40px; 
     left:570px; 
    } 
    </style> 


    <div id"wrapper"> 
    <div id="first"><div id="overlayleft"><img alt="Dr Sayer" height="94" src="view.image?Id=592" width="93" /></div><h1 style="text-align:right">Dr John Sayer</h1><p>Cystic kidney diseases, such as polycystic kidney 
    disease (PKD), are responsible for ten per cent of 
    patients requiring dialysis and transplantation in 
    the UK. As with most cystic kidney diseases, PKD 
    is a genetic condition which causes fluid-filled 
    sacks to develop on the interior and exterior of 
    the kidneys. These sacks gradually replace normal 
    kidney tissue, enlarging the organs and reducing 
    their ability to function – eventually causing them 
    to fail altogether. A recently discovered gene, 
    involved in the onset of cystic kidney diseases, 
    has provided a basis for the work of Dr John Sayer. 
    Dr Sayer is studying this specific gene closely and 
    hopes not only to improve our understanding of 
    the molecules which cause cystic kidney diseases, 
    but also test potential new drug treatments aimed 
    at preventing the formation of cysts.</p></div> 

    <div id="second"><div id="overlayright"><img alt="Donate" height="94" src="view.image?Id=592" width="93" /></div><h1>Carol Norbury</h1> 
    <p>Carol Norbury’s family has a prolonged history of polycystic 
    kidney disease. Her husband, John, was diagnosed with the condition in 1996, before 
    going on to suffer complete renal 
    failure in late 2004. Luckily, Carol 
    was found to be a suitable organ 
    donor. However, since then, each 
    of Carol and John’s three children 
    has been diagnosed with 
    the condition.</p></div> 
    <div class"clear"></div> 
    </div> 

Répondre

0

Vous devez spécifier une largeur sur le wrapper pour le "margin: 0 auto;" travailler.

ET vous manque le signe égal sur l'id emballage