SlideShare a Scribd company logo
HTML+CSS


Property display
ELEONORA ROCCHI


- 2022 -
In una pagina web


ogni elemento HTML è una scatola
rettangolare
ER 2022
Esistono due tipi di contenitore:


block e inline
ER 2022
Block
Occupa l’intera larghezza del contenitore
ER 2022
Inline
Occupa lo spazio in base al suo contenuto
ER 2022
Quando apriamo su browser una pagina web,


il browser carica per prima cosa il proprio foglio di stile;
in seguito carica il CSS contenuto nella pagina web.
ER 2022
Flusso normale
Si intende l'ordine naturale in cui gli elementi HTML appaiono sullo schermo
senza che venga applicato alcun CSS.
https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Normal_Flow
ER 2022
Gli elementi block vengono
visualizzati uno dopo l’altro:
iniziano in alto e si spostano
verso il basso nella pagina.


Gli elementi inline vengono
visualizzati nella direzione in linea,
ovvero vengono visualizzati uno
af
f
ianco all'altro, a partire da sinistra.


ER 2022
Nel
f
lusso normale
Display block
Il contenuto di un elemento a livello di blocco è il 100% della larghezza del
suo elemento padre e la sua altezza è determinata dal suo contenuto.
ER 2022
https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements
Questi elementi ammettono dimensioni ma non possono avere un altro elemento
accanto poiché coprono tutto lo spazio che hanno a disposizione, quindi
verranno posizionati dall'alto verso il basso, sebbene questo comportamento
prede
f
inito possa essere modi
f
icato utilizzando display: inline-block.


ER 2022
Display block
Blocco 1
Blocco 2
Blocco 3
Display inline
Gli elementi inline non consentono dimensioni (larghezza, altezza)
ma consentono margini, spaziatura interna e bordo.


ER 2022
https://developer.mozilla.org/en-US/docs/Web/HTML/Inline_elements
Altezza e larghezza di un elemento inline


sono determinate dal suo contenuto.


ER 2022
Display inline
Blocco 1
Blocco 2
Blocco 3
Se ci sono più elementi in una riga,


verranno posizionati da sinistra a destra


(uno accanto all'altro).


ER 2022
Display inline
Display inline-block
È una combinazione tra i due tipi di elementi block e inline.
ER 2022
Elementi con il valore display: inline-block


ammettono dimensioni ma sono comunque elementi inline,
verranno posizionati uno accanto all'altro.


ER 2022
Display inline-block
Blocco 1 Blocco 2 Blocco 3
Display none
Nasconde un elemento, che quindi non occuperà spazio.
ER 2022
La proprietà display:none nasconde l'elemento che però continua
ad esistere. Non viene visualizzato ma le risorse continuano ad
essere caricate, quindi deve essere usato con cura.


ER 2022
Display none

More Related Content

Featured

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter
 

Featured (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

CSS_property_display.pdf

  • 2. In una pagina web ogni elemento HTML è una scatola rettangolare ER 2022
  • 3. Esistono due tipi di contenitore: block e inline ER 2022
  • 4. Block Occupa l’intera larghezza del contenitore ER 2022
  • 5. Inline Occupa lo spazio in base al suo contenuto ER 2022
  • 6. Quando apriamo su browser una pagina web, il browser carica per prima cosa il proprio foglio di stile; in seguito carica il CSS contenuto nella pagina web. ER 2022
  • 7. Flusso normale Si intende l'ordine naturale in cui gli elementi HTML appaiono sullo schermo senza che venga applicato alcun CSS. https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Normal_Flow ER 2022
  • 8. Gli elementi block vengono visualizzati uno dopo l’altro: iniziano in alto e si spostano verso il basso nella pagina. Gli elementi inline vengono visualizzati nella direzione in linea, ovvero vengono visualizzati uno af f ianco all'altro, a partire da sinistra. ER 2022 Nel f lusso normale
  • 9. Display block Il contenuto di un elemento a livello di blocco è il 100% della larghezza del suo elemento padre e la sua altezza è determinata dal suo contenuto. ER 2022 https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements
  • 10. Questi elementi ammettono dimensioni ma non possono avere un altro elemento accanto poiché coprono tutto lo spazio che hanno a disposizione, quindi verranno posizionati dall'alto verso il basso, sebbene questo comportamento prede f inito possa essere modi f icato utilizzando display: inline-block. ER 2022 Display block Blocco 1 Blocco 2 Blocco 3
  • 11. Display inline Gli elementi inline non consentono dimensioni (larghezza, altezza) ma consentono margini, spaziatura interna e bordo. ER 2022 https://developer.mozilla.org/en-US/docs/Web/HTML/Inline_elements
  • 12. Altezza e larghezza di un elemento inline sono determinate dal suo contenuto. ER 2022 Display inline Blocco 1 Blocco 2 Blocco 3
  • 13. Se ci sono più elementi in una riga, verranno posizionati da sinistra a destra (uno accanto all'altro). ER 2022 Display inline
  • 14. Display inline-block È una combinazione tra i due tipi di elementi block e inline. ER 2022
  • 15. Elementi con il valore display: inline-block ammettono dimensioni ma sono comunque elementi inline, verranno posizionati uno accanto all'altro. ER 2022 Display inline-block Blocco 1 Blocco 2 Blocco 3
  • 16. Display none Nasconde un elemento, che quindi non occuperà spazio. ER 2022
  • 17. La proprietà display:none nasconde l'elemento che però continua ad esistere. Non viene visualizzato ma le risorse continuano ad essere caricate, quindi deve essere usato con cura. ER 2022 Display none