serik Posted April 18, 2006 Share Posted April 18, 2006 Voilà pour simplifier, prenons le code : <div> <p>blabla</p><br/> <input type="submit" value=">>>" name="GO"/> </div> Avec la feuille CSS: div {width:500px; } Et je cherche à avoir le input aligné à droite. J'ai beau réduire le pad ou la marge droite à 0 et mettre la gauche en auto, rien n'y fait mon élément et toujours à gauche. Merci! Link to comment Share on other sites More sharing options...
Hartycho Posted April 19, 2006 Share Posted April 19, 2006 <p align="right"><input type="submit" value=">>>" name="GO"/></p> Comme ça ? Link to comment Share on other sites More sharing options...
Baldurien Posted April 19, 2006 Share Posted April 19, 2006 Plutôt : <input type="submit" value=">>>" name="GO" style="float: right;" /> (et paf, ça peut même aller dans ta css) Link to comment Share on other sites More sharing options...
serik Posted April 19, 2006 Author Share Posted April 19, 2006 Plutôt : <input type="submit" value=">>>" name="GO" style="float: right;" /> (et paf, ça peut même aller dans ta css) En fait j'utilise une CSS, et si je met float: right, l'élément a la facheuse tendance à se retrouver à cheval sur la bordure de la div (celle du bas), et sur la bordure de droite. Et pourquoi align="rgiht" ne peut se retrouver dans la CSS? Un oubli? Link to comment Share on other sites More sharing options...
Baldurien Posted April 19, 2006 Share Posted April 19, 2006 Serik> essaye le input AVANT ton texte (c'est la magie des float) Sinon : div.machin { text-align: right; } div.machin p { float: left; } Link to comment Share on other sites More sharing options...
serik Posted April 19, 2006 Author Share Posted April 19, 2006 En fait float est inutilisable, car l'élément n'appartien plus à la DIV, et se retrouve en dehors de la bordure. La solution de Dolix semble la bonne : <div class="leftBlueBorder"> <form name="Log" method="post" action="login.php"> <p>Pseudo : <input type="text" name="Nick" maxlength="20" size="15" value=""/><br/> Pass : <input type="password" name="Pass" maxlength="20" size="15" value=""/><br/> </p> <p class="ar" align="right"><input class="ar" type="submit" name="go" value=">>>"/></p> </form> </div> div.leftBlueBorder p.ar { margin-right: 5px; } Ca semble marcher est-ce que align="right" a un équivalent en CSS? (tout en restant dans la DIV) Link to comment Share on other sites More sharing options...
Baldurien Posted April 19, 2006 Share Posted April 19, 2006 text-align: right normalement Link to comment Share on other sites More sharing options...
serik Posted April 19, 2006 Author Share Posted April 19, 2006 text-align: right normalement Mais ça c'est pour le text, si c'est pour une image c'est mort :-( Link to comment Share on other sites More sharing options...
Krogoth Posted April 19, 2006 Share Posted April 19, 2006 text-align: right normalement Mais ça c'est pour le text, si c'est pour une image c'est mort :-( Me semble avoir testé pour une image et ca passe pareil. Enfin pas très sur quand meme. Link to comment Share on other sites More sharing options...
Baldurien Posted April 20, 2006 Share Posted April 20, 2006 serik> justement. Ca aligne le flot "en ligne" sur la droite, donc image, texte, texte, etc. Tout ce qui a display: inline (je crois, voir spec pour contredire) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.