Hey, web designer in erba! Oggi troviamo tutte le proprietà CSS che renderanno la tua tipografia una vera rockstar del web. Dai caratteri eleganti e leggibili, alle dimensioni perfette, fino ai colori che catturano l'occhio, sei pronto per esplorare come gestire al meglio la tipografia con CSS?
La scelta del font è come scegliere l'outfit per una festa: può fare una grande differenza. Un font leggibile e ben scelto rende il contenuto più facile da capire e il sito più attraente.
.serif {
font-family: Times, "Times New Roman", Georgia, serif;
}
.sans-serif {
font-family: Verdana, Arial, Helvetica, sans-serif;
}
Qui sopra, abbiamo due classi: .serif
e .sans-serif
, che servono per impostare rispettivamente famiglie di caratteri con grazie (serif) e senza grazie (sans-serif).
Tip SEO: Ricorda che un font leggibile può migliorare l'esperienza utente e quindi anche il tuo ranking SEO. Dai un'occhiata al nostro articolo sull'importanza dell'UX/UI Design per saperne di più!
La proprietà font-size
è il tuo magico bacchettino per rendere il testo della dimensione perfetta.
.a-selector {
font-size: 15rem;
}
Puoi utilizzare sia valori predefiniti come large
e small
, sia valori specifici:
Vuoi del testo in grassetto che urli al mondo "Ehi, leggi qui!"? La proprietà font-weight
fa proprio al caso tuo!
.a-selector {
font-weight: bold;
}
Puoi utilizzare:
bold
lighter
bolder
100
a 900
Vuoi approfondire? Visita MDN Web Docs per una guida completa.
Colorare il testo è come dipingere il tuo mondo web. Usa la proprietà color
.
.a-selector {
color: red;
}
Puoi esprimere i colori in vari modi:
red
#ff0000
rgb(255, 0, 0)
hsl(0, 1, 0.5)
hwb(0, 0%, 0%)
Ora che conosci tutte queste proprietà CSS, sei pronto per far brillare la tipografia del tuo sito! La tipografia giusta può davvero migliorare l'esperienza utente e rendere il sito più accattivante.
Sei pronto a provare queste tecniche nel tuo prossimo progetto? Se hai domande o vuoi condividere il tuo lavoro, non esitare a contattarci.
Vuoi un sito web su misura che spacca? Scopri i nostri servizi di sviluppo web!
We have received your request. One of our operators will contact you as soon as possible to provide you with all the information you need.
Cookies improve your experience
To improve your experience on our platforms and provide you with a more personalized experience, we at One AM and our partners use and process the data and personal information you provide. Data such as your IP address, current browser, or the device used are examples of personal information that are processed directly on/from the device using cookies, storage, and similar technologies.
For more information, see our Privacy and Cookie Policy.
Your preferences will only apply to this website. You can accept, disable, or manage your choices at any time by clicking below or by accessing the "Privacy" section in the settings, under "Privacy and cookie settings" at the bottom of the page.
Some of our partners use your data based on their legitimate interest. You can object to such processing at any time. You can view and customize vendor consent here.