recherche
  • Se connecter
  • S'inscrire
Réinitialisation du mot de passe réussie

Suivez les projets qui vous intéressent et découvrez les dernières actualités les concernant.

Taille du didacticiel de base CSS, propriétés de police et de texte

Attribut de taille CSS

  • largeur : largeur de l'élément, assurez-vous d'ajouter des unités px.

  • hauteur : hauteur de l'élément.


Propriété de police CSS

  • font-size : taille du texte. Par exemple : font-size:14px;

  • font-family: font. Par exemple : font-family : Microsoft Yahei ;

  • font-style : italic, valeur : italic. Par exemple : font-style:italic;

  • font-weight : bold, valeur : bold. Tels que : font-weight:bold;


Propriété de texte CSS

  • color : couleur du texte

  • text-decoration : ligne de décoration du texte, valeurs : aucune, souligné, surligné, barré (Barré)

  • text-align : alignement horizontal du texte, valeurs : gauche, centre, droite

  • line-height : ligne High, vous pouvez utiliser une valeur fixe ou un pourcentage. Par exemple : line-height:24px; line-height:150%;

  • text-indent : retrait de la première ligne. Par exemple : text-indent:28px;

  • letter-spacing : espacement des mots.

L'exemple est le suivant

<!DOCTYPE HTML>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>php.cn</title>
    <style type="text/css">
    h1{
        color:red;
        width:350px;
        text-align:center;
        font-family:微软雅黑;
    }
    p{
         line-height:150%;
         text-indent:28px;
         font-family:楷体;
    }
    .box{
        font-style:italic;
        font-weight:bold;
        text-decoration:underline;
    }
    </style>
    </head>
    <body>
        <h1>习近平心中的互联网</h1>
        <p>互联网是20世纪最伟大的发明,它正在将人类“<span class="box">一网打尽</span>”,人们在不知不觉中已经融入了互联网生态,互联网让世界变成了“鸡犬之声相闻”的地球村。</p>
    </body>
</html>


nouveau fichier
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>php.cn</title> <style type="text/css"> h1{ color:red; width:350px; text-align:center; font-family:微软雅黑; } p{ line-height:150%; text-indent:28px; font-family:楷体; } .box{ font-style:italic; font-weight:bold; text-decoration:underline; } </style> </head> <body> <h1>习近平心中的互联网</h1> <p>互联网是20世纪最伟大的发明,它正在将人类“<span class="box">一网打尽</span>”,人们在不知不觉中已经融入了互联网生态,互联网让世界变成了“鸡犬之声相闻”的地球村。</p> </body> </html>
Réinitialiser le code
Opération automatique
soumettre
Aperçu Clear