Comment définir plusieurs propriétés d'arrière-plan dans une seule déclaration

Exemple d'analyse :

L'attribut d'arrière-plan est un attribut abrégé qui peut définir tous les attributs d'arrière-plan dans une seule instruction.

Les propriétés qui peuvent être définies sont : background-color, background-position, background-size, background-repeat, background-origin, background-clip, background-attachment et background-image.

Peu importe si l'une des valeurs ci-dessus est manquante, par exemple background : #FF0000 URL (smiley.gif est autorisé) ;






Formation continue
||
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>php中文网(php.cn)</title> <style> body { background:#ffffff url('https://img.php.cn/upload/article/000/000/015/5c6ba8b3a7ee3101.png') no-repeat right top; margin-right:200px; } </style> </head> <body> <h1>Hello World!</h1> <p>背景图片只显示一次,但它位置离文本比较远。</p> <p>在这个例子中我们添加了一个右边距,所以背景图像不会打扰到文本。</p> </body> </html>
soumettreRéinitialiser le code
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!