J'ai un problème de CSS. Im essayant de centrer verticalement le texte dans un div, qui recouvre un autre div, mais le texte ne bougera pas.Comment centrer verticalement du texte dans un div, chevauchant un autre div
EDIT: Voici Teh url jsFiddle: http://jsfiddle.net/wgSEw/3/
Le html est la suivante:
<div id="footer-top">
<div id="footer-top-left">
<div id="footer-logo">
</div>
</div>
<div id="footer-top-transition"></div>
<div id="footer-top-right"></div>
<div id="footer-top-bullets">
<div id="site-map" class="footer-bullet">
<img src="<?php echo BASE_IMG_URL . 'bulletlight.png'; ?>" alt="some_text">
<span class="footer-bullet-text">Site Map</span>
</div>
<div id="report-issue" class="footer-bullet">
<img src=<?php echo BASE_IMG_URL . 'bulletlight.png'; ?> alt="some_text">
<span class="footer-bullet-text">Report an Issue</span>
</div>
<div id="submit-professor" class="footer-bullet">
<img src=<?php echo BASE_IMG_URL . 'bulletblack.png'; ?> alt="some_text">
<span class="footer-bullet-text">Submit Professor</span>
</div>
<div id="submit-school" class="footer-bullet">
<img src=<?php echo BASE_IMG_URL . 'bulletblack.png'; ?> alt="some_text">
<span class="footer-bullet-text">Submit a School</span>
</div>
</div>
</div>
et le css actuel est:
#footer-top{
position: relative;
width: 960px;
height: 63px;
float: left;
background-image:url('midtilefooter.png');
}
#footer-top-left{
width: 466px;
height: 63px;
float: left;
}
#footer-logo{
width: 265px;
height: 63px;
float: left;
background-image:url('leftlogo.png');
}
#footer-top-transition{
width: 27px;
height: 63px;
float: left;
background-image: url('midblacktransition.png');
}
#footer-top-right{
width: 467px;
height: 63px;
float: left;
background-color: black;
}
#footer-top-bullets{
position: absolute;
float: left;
width: 960px;
height: 63px;
margin-left: 265px;
}
.footer-bullet{
float: left;
height: 63px;
width: 173px;
color: white;
}
.footer-bullet-text{
height: 63px;
color: white;
top: 50%;
margin-top: -31px;
vertical-align: middle;
}
Ce essentiellement, crée un fond de base pour la partie supérieure du pied de page, puis superpose une div de balles sur ce fond, de sorte qu'il se superpose sans obscurcir ou déconner avec l'arrière-plan. Les puces s'affichent aux endroits corrects et le texte est correctement placé horizontalement, mais je ne peux pas le placer au centre verticalement. Toute aide serait appréciée, ainsi que tout conseil général sur css, je suis assez nouveau pour ça, et ça me donne une course pour mon argent. Thansk beaucoup!
pouvez-vous s'il vous plaît créer jsfiddle.net –
il est vraiment difficile d'imaginer comment il ressemble: | – Vainglory07
Je ne suis pas très bon en php mais je pense que cette partie de votre code n'est pas bonne Php echo BASE_IMG_URL. 'bulletlight.png'; ?> – Ivo