跳动的心
不用图片,使用CSS3做出一个跳动的心。
HTML:
<span style="color: #0000ff;"> <span style="color: #800000;">div </span><span style="color: #ff0000;">class</span><span style="color: #0000ff;">="box"</span><span style="color: #0000ff;">></span> <span style="color: #0000ff;"><span style="color: #800000;">div </span><span style="color: #ff0000;">class</span><span style="color: #0000ff;">="left"</span><span style="color: #0000ff;">></span><span style="color: #800000;">div</span><span style="color: #0000ff;">></span> <span style="color: #0000ff;"><span style="color: #800000;">div </span><span style="color: #ff0000;">class</span><span style="color: #0000ff;">="right"</span><span style="color: #0000ff;">></span><span style="color: #800000;">div</span><span style="color: #0000ff;">></span> <span style="color: #0000ff;"></span><span style="color: #800000;">div</span><span style="color: #0000ff;">></span></span></span></span>
首先两个div浮动,左上和右上角变圆:
<span style="color: #800000;"> .box</span>{<span style="color: #ff0000;"> margin</span>:<span style="color: #0000ff;"> 100px</span>; }<span style="color: #800000;"> .left,.right</span>{<span style="color: #ff0000;"> float</span>:<span style="color: #0000ff;"> left</span>; }<span style="color: #800000;"> .box div</span>{<span style="color: #ff0000;"> height</span>:<span style="color: #0000ff;">160px</span>;<span style="color: #ff0000;"> width</span>:<span style="color: #0000ff;"> 100px</span>;<span style="color: #ff0000;"> border-radius</span>:<span style="color: #0000ff;"> 50px 50px 0 0</span>;<span style="color: #ff0000;"> background</span>:<span style="color: #0000ff;"> red</span>; }
变成:
然后让两个div旋转一下,左边的以右下角为旋转点正时针转45度,右边的以左下角为旋转点逆时针转45度,加点阴影:
<span style="color: #800000;">.left</span>{<span style="color: #ff0000;"> transform-origin</span>:<span style="color: #0000ff;"> 100% 100%</span>;<span style="color: #ff0000;"> transform</span>:<span style="color: #0000ff;"> rotate(45deg)</span>;<span style="color: #ff0000;"> box-shadow</span>:<span style="color: #0000ff;"> 8px 10px 10px #888888</span>; }<span style="color: #800000;"> .right</span>{<span style="color: #ff0000;"> transform-origin</span>:<span style="color: #0000ff;"> 0% 100%</span>;<span style="color: #ff0000;"> transform</span>:<span style="color: #0000ff;"> rotate(-45deg)</span>;<span style="color: #ff0000;"> box-shadow</span>:<span style="color: #0000ff;"> -10px -1px 10px #888888</span>; }<br><br>
心形出来了:
让心动起来,加点动画吧:
<span style="color: #800000;"> .box div</span>{<span style="color: #ff0000;"> animation</span>:<span style="color: #0000ff;"> lb 1s cubic-bezier(0.3,0.4,0.3,1) 0s infinite</span>;<span style="color: #ff0000;"> border</span>:<span style="color: #0000ff;"> 0px solid red</span>;/*这个不能少*/ }<span style="color: #800000;"> @keyframes lb</span>{<span style="color: #ff0000;"> 0%{ border</span>:<span style="color: #0000ff;"> 10px solid red</span>;<span style="color: #ff0000;"> border-radius</span>:<span style="color: #0000ff;"> 58px 58px 0 0</span>; }<span style="color: #800000;"> 50%</span>{<span style="color: #ff0000;"> border</span>:<span style="color: #0000ff;"> 20px solid red</span>;<span style="color: #ff0000;"> border-radius</span>:<span style="color: #0000ff;"> 66px 66px 0 0</span>; }<span style="color: #800000;"> 100%</span>{<span style="color: #ff0000;"> border</span>:<span style="color: #0000ff;">0px solid red</span>;<span style="color: #ff0000;"> border-radius</span>:<span style="color: #0000ff;"> 50px 50px 0 0</span>; }<span style="color: #800000;"> }</span>
好了,一颗跳动的心就完成了。
完整CSS:
<span style="color: #800000;"> <style> .box</style></span>{<span style="color: #ff0000;"> margin</span>:<span style="color: #0000ff;"> 100px</span>; }<span style="color: #800000;"> .left,.right</span>{<span style="color: #ff0000;"> float</span>:<span style="color: #0000ff;"> left</span>; }<span style="color: #800000;"> .box div</span>{<span style="color: #ff0000;"> height</span>:<span style="color: #0000ff;">160px</span>;<span style="color: #ff0000;"> width</span>:<span style="color: #0000ff;"> 100px</span>;<span style="color: #ff0000;"> border-radius</span>:<span style="color: #0000ff;"> 50px 50px 0 0</span>;<span style="color: #ff0000;"> background</span>:<span style="color: #0000ff;"> red</span>;<span style="color: #ff0000;"> animation</span>:<span style="color: #0000ff;"> lb 1s cubic-bezier(0.3,0.4,0.3,1) 0s infinite</span>;<span style="color: #ff0000;"> border</span>:<span style="color: #0000ff;"> 0px solid red</span>; }<span style="color: #800000;"> .left</span>{<span style="color: #ff0000;"> transform-origin</span>:<span style="color: #0000ff;"> 100% 100%</span>;<span style="color: #ff0000;"> transform</span>:<span style="color: #0000ff;"> rotate(45deg)</span>;<span style="color: #ff0000;"> box-shadow</span>:<span style="color: #0000ff;"> 8px 10px 10px #888888</span>; }<span style="color: #800000;"> @keyframes lb</span>{<span style="color: #ff0000;"> 0%{ border</span>:<span style="color: #0000ff;"> 10px solid red</span>;<span style="color: #ff0000;"> border-radius</span>:<span style="color: #0000ff;"> 58px 58px 0 0</span>; }<span style="color: #800000;"> 50%</span>{<span style="color: #ff0000;"> border</span>:<span style="color: #0000ff;"> 20px solid red</span>;<span style="color: #ff0000;"> border-radius</span>:<span style="color: #0000ff;"> 66px 66px 0 0</span>; }<span style="color: #800000;"> 100%</span>{<span style="color: #ff0000;"> border</span>:<span style="color: #0000ff;">0px solid red</span>;<span style="color: #ff0000;"> border-radius</span>:<span style="color: #0000ff;"> 50px 50px 0 0</span>; }<span style="color: #800000;"> } .right</span>{<span style="color: #ff0000;"> transform-origin</span>:<span style="color: #0000ff;"> 0% 100%</span>;<span style="color: #ff0000;"> transform</span>:<span style="color: #0000ff;"> rotate(-45deg)</span>;<span style="color: #ff0000;"> box-shadow</span>:<span style="color: #0000ff;"> -10px -1px 10px #888888</span>; }<span style="color: #800000;"> </span>

Outils d'IA chauds

Undresser.AI Undress
Application basée sur l'IA pour créer des photos de nu réalistes

AI Clothes Remover
Outil d'IA en ligne pour supprimer les vêtements des photos.

Undress AI Tool
Images de déshabillage gratuites

Clothoff.io
Dissolvant de vêtements AI

AI Hentai Generator
Générez AI Hentai gratuitement.

Article chaud

Outils chauds

Bloc-notes++7.3.1
Éditeur de code facile à utiliser et gratuit

SublimeText3 version chinoise
Version chinoise, très simple à utiliser

Envoyer Studio 13.0.1
Puissant environnement de développement intégré PHP

Dreamweaver CS6
Outils de développement Web visuel

SublimeText3 version Mac
Logiciel d'édition de code au niveau de Dieu (SublimeText3)

L'article traite du HTML & lt; Progress & GT; élément, son but, son style et ses différences par rapport au & lt; mètre & gt; élément. L'objectif principal est de l'utiliser & lt; Progress & gt; pour l'achèvement des tâches et & lt; mètre & gt; pour stati

L'article traite du HTML & lt; Datalist & GT; élément, qui améliore les formulaires en fournissant des suggestions de saisie semi-automatique, en améliorant l'expérience utilisateur et en réduisant les erreurs. COMMANDE COMPRES: 159

L'article traite du HTML & lt; mètre & gt; élément, utilisé pour afficher des valeurs scalaires ou fractionnaires dans une plage, et ses applications courantes dans le développement Web. Il différencie & lt; mètre & gt; De & lt; Progress & gt; et ex

L'article traite de la balise Meta de la fenêtre, essentielle pour la conception Web réactive sur les appareils mobiles. Il explique comment une utilisation appropriée garantit une mise à l'échelle optimale du contenu et une interaction utilisateur, tandis que la mauvaise utilisation peut entraîner des problèmes de conception et d'accessibilité.

L'article traite du & lt; iframe & gt; L'objectif de Tag dans l'intégration du contenu externe dans les pages Web, ses utilisations courantes, ses risques de sécurité et ses alternatives telles que les balises d'objet et les API.

HTML convient aux débutants car il est simple et facile à apprendre et peut rapidement voir les résultats. 1) La courbe d'apprentissage de HTML est fluide et facile à démarrer. 2) Il suffit de maîtriser les balises de base pour commencer à créer des pages Web. 3) Flexibilité élevée et peut être utilisée en combinaison avec CSS et JavaScript. 4) Les ressources d'apprentissage riches et les outils modernes soutiennent le processus d'apprentissage.

HTML définit la structure Web, CSS est responsable du style et de la mise en page, et JavaScript donne une interaction dynamique. Les trois exercent leurs fonctions dans le développement Web et construisent conjointement un site Web coloré.

Anexampleofastartingtaginhtmlis, qui abinginsaparagraph.startingtagsaressentialtinhtmlastheyinitiateelements, définit les éventualités, et la faculté de réduction des pages et de la construction de la création.
