Problème alignement titre

Résolu
novis -  
 novis -
Bonjour,

Mon titre se compose de deux mots. Un des deux mots et en gras et l'autre normal. Je souhaite qu'ils apparaissent sur la même ligne mais lorsque je regarde le rendu le mot en gras apparait en dessous du mot normal.
je donne un exemple pour être plus claire. Moi je voudrais:

PEINTURES contemporaines

et il me met:
PEINTURES
contemporaines

les codes insérés sont:
<bold>html:</bold>
</a>
<div class="caption"><a href="">PEINTURES<b><span>contemporaines</span></b></a>


css:
.item .caption a {
 text-decoration:none;
 color:#9400D3;
 font-size:20px; 
 font-weight:normal;
        text-align:center;
       

 /* add spacing and make the whole row clickable*/
 padding:5px;
 display:block;
}

.item .caption b {
 text-decoration:none;
 color:#9400D3;
 font-size:20px; 
 font-weight:bold;
        text-align:center;
       

 /* add spacing and make the whole row clickable*/
 padding:5px;
 display:block;
}


EDIT : Ajout des balises de code (la coloration syntaxique).

Explications disponibles ici :ICI

Merci d'y penser dans tes prochains messages.
Jordane45


Comprenez-vous mon erreur?

Merci beaucoup
Novis

2 réponses

  1. jordane45 Messages postés 30427 Date d'inscription   Statut Modérateur Dernière intervention   4 832
     
    Bonjour,

    Tu as utilisé le display BLOCK
    Comme ça .. je dirais.. essaye en INLINE-BLOCK

    Pour info :

    Inline elements:

    respect left & right margins and padding, but not top & bottom
    cannot have a width and height set
    allow other elements to sit to their left and right.
    see very important side notes on this here.

    Block elements:

    respect all of those
    force a line break after the block element

    Inline-block elements:

    allow other elements to sit to their left and right
    respect top & bottom margins and padding
    respect height and width


    1
  2. novis
     
    Super!!
    Merci Jordane!! Effectivement c'est bien ce qu'il fallait faire! je ne connaissais pas cette fonction! Merci de m'avoir éclairé!
    Super sympa!
    0