Dimension CSS
Propriété de dimension CSS
| 属性 | 描述 |
|---|---|
| height | 设置元素的高度。 |
| line-height | 设置行高。 |
| max-height | 设置元素的最大高度。 |
| max-width | 设置元素的最大宽度。 |
| min-height | 设置元素的最小高度。 |
| min-width | 设置元素的最小宽度。 |
| width | 设置元素的宽度。 |
Instance
Définissez la hauteur de l'image en utilisant des pourcentages
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>php中文网(php.cn)</title>
<style>
html {height:100%;}
body {height:100%;}
img.normal {height:auto;}
img.big {height:30%;}
img.small {height:10%;}
</style>
</head>
<body>
<img class="normal" src="/upload/course/000/000/006/5809800b44336872.jpg" width="95" height="84" /><br>
<img class="big" src="/upload/course/000/000/006/5809800b44336872.jpg" width="95" height="84" /><br>
<img class="small" src="/upload/course/000/000/006/5809800b44336872.jpg" width="95" height="84" />
</body>
</html>Exécutez le programme pour l'essayer
Exemple
Définir la hauteur minimale de l'élément
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>php中文网(php.cn)</title>
<style>
p
{
min-height:100px;
background-color:yellow;
}
</style>
</head>
<body>
<p>这一段的最小高度设置为100 px。</p>
</body>
</html>Exécutez le programme pour l'essayer
nouveau fichier
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>php中文网(php.cn)</title>
<style>
html {height:100%;}
body {height:100%;}
img.normal {height:auto;}
img.big {height:30%;}
img.small {height:10%;}
</style>
</head>
<body>
<img class="normal" src="https://img.php.cn/upload/course/000/000/006/5809800b44336872.jpg" width="95" height="84" /><br>
<img class="big" src="https://img.php.cn/upload/course/000/000/006/5809800b44336872.jpg" width="95" height="84" /><br>
<img class="small" src="https://img.php.cn/upload/course/000/000/006/5809800b44336872.jpg" width="95" height="84" />
</body>
</html>
Aperçu
Clear
Les étudiants qui ont regardé ce cours apprennent également
Parlons brièvement de la création d'une entreprise en PHP
Introduction rapide au développement web front-end
Développement pratique à grande échelle par Tianlongbabu du cadre MVC version Mini imitant le site Web de l'encyclopédie des choses embarrassantes
Premiers pas avec le développement pratique PHP : création rapide de PHP [Small Business Forum]
Vérification de connexion et forum de discussion classique
Collecte de connaissances sur les réseaux informatiques
Démarrage rapide de la version complète de Node.JS
Le cours front-end qui vous comprend le mieux : HTML5/CSS3/ES6/NPM/Vue/...[Original]
Écrivez votre propre framework PHP MVC (40 chapitres en profondeur/gros détails/à lire absolument pour que les débutants progressent)
















Le didacticiel n'est pas disponible au téléchargement pour le moment. Le staff est actuellement en train de l'organiser. Veuillez prêter plus d'attention à ce cours à l'avenir ~ 