DOMANDA Dubbio HTML (dimensioni - uso di span)

MPG

Utente Attivo
544
4
Scusate sono all'inizio con l'html mi potete spiegare perchè usando il primo listato la scritta "Paris is the capital of France" viene piu' piccola di "Paris" sopra?
Nel secondo important è sempre in rosso ma non capisco bene l'uso di span.note sopra e poi invece l''uso di
span class="note">Important</span> piu' sotto che porta la parola important and essere sempre rossa.
Grazie a tutti.

HTML:
<!DOCTYPE html>
<html>
<style>
.city {
background-color: tomato;
color: white;
padding: 10px;
}
</style>
<body>

<h2>Same Class, Different Tag</h2>
<p>Even if the two elements do not have the same tag name, they can have the same class name, and get the same styling:</p>

<h2 class="city">Paris</h2>
<p class="city">Paris is the capital of France.</p>

</body>
</html>

HTML:
<!DOCTYPE html>
<html>
<head>
<style>
span.note {
  font-size: 120%;
  color: red;
}
</style>
</head>
<body>

<h1>My <span class="note">Important</span> Heading</h1>
<p>This is some <span class="note">important</span> text.</p>

</body>
</html>
 
Ultima modifica:

Skills07

Head of Development
Staff Forum
Utente Èlite
35,447
11,502
CPU
Ryzen 7 5800x
Dissipatore
Deepcool gammax l240 v2
Scheda Madre
Aourus Gigabyte X-470 ultra gaming
HDD
Samsung Evo 850 250gb ,2tb x 2 toshiba P300, 256 Ssd silicon power, Samsung evo plus 1tb nvme
RAM
32 gb G.Skill Tridentz 3200 mhz RGB
GPU
Zotac - RTX 3070 Ti Trinity OC
Monitor
ASUS TUF QHD 165hz IPS, ITEK GCF 165hz IPS QHD, Samsung Curvo 144hz QHD
PSU
Seasonic Focus 650w 80 platinum
Case
Coolermaster h500p
Periferiche
Asus Tuf Wireless
Net
Fibra Tim 100mb
OS
Windows 10 Pro 64 bit
ciao in che senso viene piu grande??
Hai dichiarato un h2 con class city e lo span con la stessa classe.
 

Entra

oppure Accedi utilizzando
Discord Ufficiale Entra ora!

Discussioni Simili