Whether editing an existing theme for a Wordpress site or building out the styles from scratch, it's beneficial to understand how styles apply and override. In this talk, we'll take a deep dive into how CSS works under the hood and how to make better decisions when writing CSS.
What we'll cover:
• How browsers determine which styles to apply
• Best practices for writing selectors
• How specificity works
• Specificity anti-patterns
About the Speaker:
Sarah Hudson is a UI Developer at Cardinal Solutions. With a background in product development, she has worked with companies big and small to build their projects from sketch to launch. Coding is basically her entire life, but when she's not hacking, she's geeking out over 80's music or scheming her next big adventure.
Css specificity inheritance and the cascade things you should knowMoneer kamal
Specificity, inheritance, and the cascade are three important concepts that determine which CSS styles get applied. Specificity refers to rules of precedence when multiple selectors could apply based on the number of ID, class, element, and inline style references. Inheritance allows elements to take on styles of parent elements by default or with the inherit value. The cascade is a process that sorts rules by importance, specificity, source order, and properties to determine which styles win when conflicts occur.
CSS defines the appearance of HTML elements through style rules that specify property-value pairs. CSS style rules can control font properties, layout, print styles, and dynamic effects. When multiple style rules apply to an element, CSS uses the cascade principle to determine which rule takes precedence based on specificity, inheritance, and location. CSS properties accept various value types including colors defined by name, RGB/RGBA, HSL/HSLA, hex values, URLs, and lengths.
When it comes to ensuring your users get the best possible user experience out of your app, it’s better to answer which countries your app will be available in sooner than later. Whether you’re building enterprise scale software or working freelance on apps for clients, internationalizing and localizing your website is no easy feat. Luckily, the community has stepped up to provide solutions to keep our code flexible and DRY.
In this talk, Angular developer Sarah Hudson will answer the questions of what internationalization and localization are, and how you can setup your Angular app to handle multiple locales. We’ll go over:
• The built in $locale service and filters for handling date and currency
• The angular translate plugin
• Handling calendars for alternative date and day of week formats
• How to check for and store locale
• How to force directives to refresh locale on the fly
• Issues you may face while implementing i18n and questions you may want to ask
This document provides an introduction to CSS (Cascading Style Sheets). It defines CSS as a language used to control the style and layout of web pages, and describes some key advantages like separation of style from content, ability to change appearance globally, and compatibility across devices. It also outlines common CSS syntax like selectors that target elements by type, class, ID and other attributes to style them.
Advanced CSS
by: Alexandra Vlachakis
Sandy Creek High School, Fayette County Schools
Slide Show correlates Georgia Deparment of Edcuation Career and Technology PATHWAY: Interactive Media
COURSE: Advanced Web Design
UNIT 6: BCS-AWD-6 Advanced CSS
The document provides an overview of CSS (Cascading Style Sheets) methodology. It defines CSS as the language used for implementing designs on HTML documents. It then covers CSS basics including selectors, properties, conflicts resolution using specificity and cascade order. It also discusses the box model which defines how browsers handle rectangular boxes for elements. Finally, it offers some best practices tips such as resetting styles, separating content from design, and planning layout during HTML coding.
This document provides an overview of CSS (Cascading Style Sheets) for computer science students. It discusses the background and goals of CSS, including making it easy to update many pages at once and maintain consistency. It also covers how CSS works through rules, selectors, and the cascade to match rules to elements. The document then summarizes visual formatting techniques in CSS like fonts, colors, positioning, and the box model. It concludes with techniques for dual presentation to support browsers with and without CSS.
This document provides an overview of CSS (Cascading Style Sheets) for computer science students. It discusses:
- The background and goals of CSS including separating structure and presentation, easing website updates, and maintaining consistency.
- An overview of key CSS concepts including rules, selectors, the parse tree, inheritance, and the cascade order for determining which styles apply.
- Visual formatting techniques including specifying fonts, colors, image positioning, the box model, and borders.
- Methods for dual presentation to ensure usable content if CSS is not supported or not working properly, such as hiding non-essential content and using parsing bugs for browser detection.
Css specificity inheritance and the cascade things you should knowMoneer kamal
Specificity, inheritance, and the cascade are three important concepts that determine which CSS styles get applied. Specificity refers to rules of precedence when multiple selectors could apply based on the number of ID, class, element, and inline style references. Inheritance allows elements to take on styles of parent elements by default or with the inherit value. The cascade is a process that sorts rules by importance, specificity, source order, and properties to determine which styles win when conflicts occur.
CSS defines the appearance of HTML elements through style rules that specify property-value pairs. CSS style rules can control font properties, layout, print styles, and dynamic effects. When multiple style rules apply to an element, CSS uses the cascade principle to determine which rule takes precedence based on specificity, inheritance, and location. CSS properties accept various value types including colors defined by name, RGB/RGBA, HSL/HSLA, hex values, URLs, and lengths.
When it comes to ensuring your users get the best possible user experience out of your app, it’s better to answer which countries your app will be available in sooner than later. Whether you’re building enterprise scale software or working freelance on apps for clients, internationalizing and localizing your website is no easy feat. Luckily, the community has stepped up to provide solutions to keep our code flexible and DRY.
In this talk, Angular developer Sarah Hudson will answer the questions of what internationalization and localization are, and how you can setup your Angular app to handle multiple locales. We’ll go over:
• The built in $locale service and filters for handling date and currency
• The angular translate plugin
• Handling calendars for alternative date and day of week formats
• How to check for and store locale
• How to force directives to refresh locale on the fly
• Issues you may face while implementing i18n and questions you may want to ask
This document provides an introduction to CSS (Cascading Style Sheets). It defines CSS as a language used to control the style and layout of web pages, and describes some key advantages like separation of style from content, ability to change appearance globally, and compatibility across devices. It also outlines common CSS syntax like selectors that target elements by type, class, ID and other attributes to style them.
Advanced CSS
by: Alexandra Vlachakis
Sandy Creek High School, Fayette County Schools
Slide Show correlates Georgia Deparment of Edcuation Career and Technology PATHWAY: Interactive Media
COURSE: Advanced Web Design
UNIT 6: BCS-AWD-6 Advanced CSS
The document provides an overview of CSS (Cascading Style Sheets) methodology. It defines CSS as the language used for implementing designs on HTML documents. It then covers CSS basics including selectors, properties, conflicts resolution using specificity and cascade order. It also discusses the box model which defines how browsers handle rectangular boxes for elements. Finally, it offers some best practices tips such as resetting styles, separating content from design, and planning layout during HTML coding.
This document provides an overview of CSS (Cascading Style Sheets) for computer science students. It discusses the background and goals of CSS, including making it easy to update many pages at once and maintain consistency. It also covers how CSS works through rules, selectors, and the cascade to match rules to elements. The document then summarizes visual formatting techniques in CSS like fonts, colors, positioning, and the box model. It concludes with techniques for dual presentation to support browsers with and without CSS.
This document provides an overview of CSS (Cascading Style Sheets) for computer science students. It discusses:
- The background and goals of CSS including separating structure and presentation, easing website updates, and maintaining consistency.
- An overview of key CSS concepts including rules, selectors, the parse tree, inheritance, and the cascade order for determining which styles apply.
- Visual formatting techniques including specifying fonts, colors, image positioning, the box model, and borders.
- Methods for dual presentation to ensure usable content if CSS is not supported or not working properly, such as hiding non-essential content and using parsing bugs for browser detection.
This document provides an overview of CSS (Cascading Style Sheets) for computer science students. It discusses:
1. The background and goals of CSS including making updates to many pages at once and maintaining consistency.
2. An overview of CSS including color, font, border, and position.
3. How CSS works by applying rules through selectors that match elements and applying properties to change presentation. The cascade determines which rules take precedence.
4. Examples of using CSS for visual formatting of fonts, colors, images, and applying the box model for layout.
This document provides an overview of CSS (Cascading Style Sheets) for computer science students. It discusses the background and goals of CSS, including making it easy to update many pages at once and maintain consistency. It also summarizes how CSS works through rules, selectors, and the cascade to match rules to elements in the parse tree. The document outlines key CSS concepts like visual formatting, fonts, colors, positioning, and hiding CSS for dual presentation in browsers with and without full CSS support.
CSS is used to control the style and formatting of HTML documents. It allows separation of document content from document presentation, including elements like color, fonts, spacing, and layout. CSS syntax uses selectors to apply styles specified by properties and values. Common selectors include element tags, classes, IDs, and descendant/child relationships. CSS handles global presentation of HTML pages for various devices.
CSS is used to control the style and formatting of HTML documents. It allows separation of document content from document presentation, including elements like color, fonts, spacing, and layout. CSS syntax uses selectors to apply styles specified by properties and values. Common selectors include element tags, classes, IDs, and descendant selectors. CSS handles global presentation of HTML pages for various devices.
This document provides an introduction to CSS (Cascading Style Sheets) through a series of lessons:
1. The history and purpose of CSS is discussed, noting that it was proposed in 1994 to help solve formatting problems in HTML.
2. CSS syntax and structure are explained, including selectors, properties and values, declarations, and declaration blocks. Examples are provided of how CSS can be used to style HTML elements.
3. Additional CSS selectors like classes and IDs are covered, along with creating comments in CSS. Students are assigned to create basic CSS pages demonstrating these concepts.
4. Methods for applying CSS styles are reviewed, including inline, internal, and external styling. Best practices
Drupal's theming layer is a powerful and beautiful beast, but it requires a firm hand to really behave. New themers often start out trying to control it with a light touch and gentle strokes of CSS. Only too late do they realize their error…
All too often the result of this misguided approach is bloated and inefficient CSS and JavaScript and site out of control. By the time the themer realizes what the beast have done, it might be too late to fix.
Don't let Contrib bully you around. Grab the reins, create a frontend architecture and teach the theming layer to produce lean, extendable, high performance markup and CSS that is easy and cost-efficient to maintain.
This session is about learning to take charge.
CSS is used to control the style and formatting of web pages. It allows separation of document content from document presentation, including elements like layout, colors, and fonts. This tutorial provides an introduction to CSS and its syntax and selectors, explaining how CSS rules are structured and various ways CSS can be associated with HTML documents, including inline, internal and external stylesheets. Key topics covered include the CSS box model, properties, pseudo-classes and pseudo-elements, and the CSS cascade.
Cascading Style Sheets, fondly referred to as CSS, is a simple design language intended to
simplify the process of making web pages presentable.
CSS handles the look and feel part of a web page. Using CSS, you can control the color of the
text, the style of fonts, the spacing between paragraphs, how columns are sized and laid out,
what background images or colors are used, as well as a variety of other effects.
CSS is easy to learn and understand but it provides powerful control over the presentation of an
HTML document. Most commonly, CSS is combined with the markup languages HTML or XHTML.
CSS is used to control the style and layout of web pages. It allows control over color, font, size, spacing, and various other visual effects without having to modify the HTML content. CSS rules are made of selectors that specify which elements the styles apply to, properties that define what is being styled, and values that are assigned to the properties. There are different ways to associate CSS with HTML including internal stylesheets, external stylesheets, inline styles, and CSS imports. CSS prioritizes rules based on how they are associated with the HTML.
CSS is used to control the style and layout of web pages. It allows control over color, font, size, spacing, and various other visual effects without having to modify the HTML content. CSS rules are made of selectors that specify which elements the styles apply to, properties that define what is being styled, and values that are assigned to the properties. There are different ways to associate CSS with HTML including internal stylesheets, external stylesheets, inline styles, and CSS imports. CSS prioritizes rules based on how they are associated with the HTML.
This document discusses semantic HTML and CSS. It provides examples of using semantic HTML elements like <div> and <span> with class and ID attributes to structure a document. It then explains how to apply CSS styles using selectors to target these elements and control things like font styles. Exercises are given to add semantic markup and CSS styles to sample texts.
This document provides an introduction to CSS (Cascading Style Sheets) through a series of lessons:
- Lesson 1 defines CSS and its history, purpose of separating formatting from content, and examples of how CSS changes page appearance without altering HTML.
- Lesson 2 explains CSS syntax including selectors, declarations, properties/values, and declaration blocks. Students create their first CSS page.
- Lesson 3 covers CSS class and ID selectors. Students create pages using class and ID selectors.
- Lesson 4 describes three methods to apply CSS - inline, internal, and external style sheets.
The document includes assignments for students to practice CSS concepts by modifying provided code examples.
Cascading Style Sheets (CSS) is a language for styling web pages that separates presentation from content. CSS handles the look and feel of a web page by controlling color, fonts, spacing, sizing, backgrounds, and other visual aspects. CSS provides powerful control over HTML elements while keeping web pages lightweight and load faster. CSS rules can be applied internally, inline, or externally through linked style sheets to globally style elements across multiple web pages. Common CSS properties control color, fonts, text, backgrounds, borders, positioning, and visual effects.
This document discusses CSS (Cascading Style Sheets) and how it can be used to style web pages. It begins by defining CSS and listing some of its main advantages, such as allowing reuse of styles across pages and faster loading times. It then covers CSS syntax, selectors, properties and values. The document also discusses the different methods of associating CSS with HTML, including inline, internal and external stylesheets. Finally, it provides examples of how to style specific elements like fonts, text, backgrounds and more using CSS.
This document discusses CSS (Cascading Style Sheets) and its use in web design. It covers topics like the basic syntax of CSS, different types of CSS selectors like element, ID, and class selectors, and different ways of inserting CSS like external, internal, and inline styles. It also discusses how to manage backgrounds, text, links, lists, tables, and boxes using various CSS properties and values. The document is intended as a learning resource for the DCA (Diploma in Computer Application) course.
This document provides an overview of Cascading Style Sheets (CSS) including:
- The different ways to apply CSS such as inline styles, embedded styles, and external styles.
- Various CSS selectors like tag selectors, class selectors, ID selectors, and combination selectors that allow targeting specific elements.
- CSS properties for styling elements with regards to colors, text, margins, paddings, and borders.
- The benefits of using CSS including separation of structure and presentation, consistency across pages, and reduced file size compared to only using HTML for styling.
Tim Berners-Lee imagined the World Wide Web as a space for interconnecting documents through hyperlinks. He created HTML to provide the structure and formatting for documents, CSS for presentation, and JavaScript for interactivity. These three languages work together to display content on the web. HTML uses tags to mark up content like paragraphs, headings, and images. CSS controls how content is styled and presented using selectors, rules and property-value pairs. It can be linked via external stylesheets, embedded in HTML, or used inline. JavaScript adds interactive behaviors to webpages.
Presentation to the Triangle Drupal Users Group (TriDUG) July meeting. This is a brief overview of what CSS selectors are and how they can be used to target CSS at specific parts of Drupal pages.
Note: This was done using the Fusion Starter theme in Drupal 7 but is applicable to D6 and other "major" themes.
Sorry, the slide animations did not come thru... but only the before and after slide really got effected.
This document outlines the topics that will be covered in the CS 382 Web Technologies course. Key topics include CSS, JavaScript, jQuery, AJAX, JSON, PHP, and web services. Students will complete a project, assignments, midterm and final exam. The course will be 90% practical, focusing on building skills with HTML, CSS, PHP, MySQL, and tools like NetBeans and Photoshop. Styles are defined separately from HTML to control appearance and layout of web pages. Different selectors like element, class, and ID are introduced to target specific styles.
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSISTier1 app
Are you ready to unlock the secrets hidden within Java thread dumps? Join us for a hands-on session where we'll delve into effective troubleshooting patterns to swiftly identify the root causes of production problems. Discover the right tools, techniques, and best practices while exploring *real-world case studies of major outages* in Fortune 500 enterprises. Engage in interactive lab exercises where you'll have the opportunity to troubleshoot thread dumps and uncover performance issues firsthand. Join us and become a master of Java thread dump analysis!
Using Query Store in Azure PostgreSQL to Understand Query PerformanceGrant Fritchey
Microsoft has added an excellent new extension in PostgreSQL on their Azure Platform. This session, presented at Posette 2024, covers what Query Store is and the types of information you can get out of it.
More Related Content
Similar to Charlotte FED - CSS Inheritance and Specificity
This document provides an overview of CSS (Cascading Style Sheets) for computer science students. It discusses:
1. The background and goals of CSS including making updates to many pages at once and maintaining consistency.
2. An overview of CSS including color, font, border, and position.
3. How CSS works by applying rules through selectors that match elements and applying properties to change presentation. The cascade determines which rules take precedence.
4. Examples of using CSS for visual formatting of fonts, colors, images, and applying the box model for layout.
This document provides an overview of CSS (Cascading Style Sheets) for computer science students. It discusses the background and goals of CSS, including making it easy to update many pages at once and maintain consistency. It also summarizes how CSS works through rules, selectors, and the cascade to match rules to elements in the parse tree. The document outlines key CSS concepts like visual formatting, fonts, colors, positioning, and hiding CSS for dual presentation in browsers with and without full CSS support.
CSS is used to control the style and formatting of HTML documents. It allows separation of document content from document presentation, including elements like color, fonts, spacing, and layout. CSS syntax uses selectors to apply styles specified by properties and values. Common selectors include element tags, classes, IDs, and descendant/child relationships. CSS handles global presentation of HTML pages for various devices.
CSS is used to control the style and formatting of HTML documents. It allows separation of document content from document presentation, including elements like color, fonts, spacing, and layout. CSS syntax uses selectors to apply styles specified by properties and values. Common selectors include element tags, classes, IDs, and descendant selectors. CSS handles global presentation of HTML pages for various devices.
This document provides an introduction to CSS (Cascading Style Sheets) through a series of lessons:
1. The history and purpose of CSS is discussed, noting that it was proposed in 1994 to help solve formatting problems in HTML.
2. CSS syntax and structure are explained, including selectors, properties and values, declarations, and declaration blocks. Examples are provided of how CSS can be used to style HTML elements.
3. Additional CSS selectors like classes and IDs are covered, along with creating comments in CSS. Students are assigned to create basic CSS pages demonstrating these concepts.
4. Methods for applying CSS styles are reviewed, including inline, internal, and external styling. Best practices
Drupal's theming layer is a powerful and beautiful beast, but it requires a firm hand to really behave. New themers often start out trying to control it with a light touch and gentle strokes of CSS. Only too late do they realize their error…
All too often the result of this misguided approach is bloated and inefficient CSS and JavaScript and site out of control. By the time the themer realizes what the beast have done, it might be too late to fix.
Don't let Contrib bully you around. Grab the reins, create a frontend architecture and teach the theming layer to produce lean, extendable, high performance markup and CSS that is easy and cost-efficient to maintain.
This session is about learning to take charge.
CSS is used to control the style and formatting of web pages. It allows separation of document content from document presentation, including elements like layout, colors, and fonts. This tutorial provides an introduction to CSS and its syntax and selectors, explaining how CSS rules are structured and various ways CSS can be associated with HTML documents, including inline, internal and external stylesheets. Key topics covered include the CSS box model, properties, pseudo-classes and pseudo-elements, and the CSS cascade.
Cascading Style Sheets, fondly referred to as CSS, is a simple design language intended to
simplify the process of making web pages presentable.
CSS handles the look and feel part of a web page. Using CSS, you can control the color of the
text, the style of fonts, the spacing between paragraphs, how columns are sized and laid out,
what background images or colors are used, as well as a variety of other effects.
CSS is easy to learn and understand but it provides powerful control over the presentation of an
HTML document. Most commonly, CSS is combined with the markup languages HTML or XHTML.
CSS is used to control the style and layout of web pages. It allows control over color, font, size, spacing, and various other visual effects without having to modify the HTML content. CSS rules are made of selectors that specify which elements the styles apply to, properties that define what is being styled, and values that are assigned to the properties. There are different ways to associate CSS with HTML including internal stylesheets, external stylesheets, inline styles, and CSS imports. CSS prioritizes rules based on how they are associated with the HTML.
CSS is used to control the style and layout of web pages. It allows control over color, font, size, spacing, and various other visual effects without having to modify the HTML content. CSS rules are made of selectors that specify which elements the styles apply to, properties that define what is being styled, and values that are assigned to the properties. There are different ways to associate CSS with HTML including internal stylesheets, external stylesheets, inline styles, and CSS imports. CSS prioritizes rules based on how they are associated with the HTML.
This document discusses semantic HTML and CSS. It provides examples of using semantic HTML elements like <div> and <span> with class and ID attributes to structure a document. It then explains how to apply CSS styles using selectors to target these elements and control things like font styles. Exercises are given to add semantic markup and CSS styles to sample texts.
This document provides an introduction to CSS (Cascading Style Sheets) through a series of lessons:
- Lesson 1 defines CSS and its history, purpose of separating formatting from content, and examples of how CSS changes page appearance without altering HTML.
- Lesson 2 explains CSS syntax including selectors, declarations, properties/values, and declaration blocks. Students create their first CSS page.
- Lesson 3 covers CSS class and ID selectors. Students create pages using class and ID selectors.
- Lesson 4 describes three methods to apply CSS - inline, internal, and external style sheets.
The document includes assignments for students to practice CSS concepts by modifying provided code examples.
Cascading Style Sheets (CSS) is a language for styling web pages that separates presentation from content. CSS handles the look and feel of a web page by controlling color, fonts, spacing, sizing, backgrounds, and other visual aspects. CSS provides powerful control over HTML elements while keeping web pages lightweight and load faster. CSS rules can be applied internally, inline, or externally through linked style sheets to globally style elements across multiple web pages. Common CSS properties control color, fonts, text, backgrounds, borders, positioning, and visual effects.
This document discusses CSS (Cascading Style Sheets) and how it can be used to style web pages. It begins by defining CSS and listing some of its main advantages, such as allowing reuse of styles across pages and faster loading times. It then covers CSS syntax, selectors, properties and values. The document also discusses the different methods of associating CSS with HTML, including inline, internal and external stylesheets. Finally, it provides examples of how to style specific elements like fonts, text, backgrounds and more using CSS.
This document discusses CSS (Cascading Style Sheets) and its use in web design. It covers topics like the basic syntax of CSS, different types of CSS selectors like element, ID, and class selectors, and different ways of inserting CSS like external, internal, and inline styles. It also discusses how to manage backgrounds, text, links, lists, tables, and boxes using various CSS properties and values. The document is intended as a learning resource for the DCA (Diploma in Computer Application) course.
This document provides an overview of Cascading Style Sheets (CSS) including:
- The different ways to apply CSS such as inline styles, embedded styles, and external styles.
- Various CSS selectors like tag selectors, class selectors, ID selectors, and combination selectors that allow targeting specific elements.
- CSS properties for styling elements with regards to colors, text, margins, paddings, and borders.
- The benefits of using CSS including separation of structure and presentation, consistency across pages, and reduced file size compared to only using HTML for styling.
Tim Berners-Lee imagined the World Wide Web as a space for interconnecting documents through hyperlinks. He created HTML to provide the structure and formatting for documents, CSS for presentation, and JavaScript for interactivity. These three languages work together to display content on the web. HTML uses tags to mark up content like paragraphs, headings, and images. CSS controls how content is styled and presented using selectors, rules and property-value pairs. It can be linked via external stylesheets, embedded in HTML, or used inline. JavaScript adds interactive behaviors to webpages.
Presentation to the Triangle Drupal Users Group (TriDUG) July meeting. This is a brief overview of what CSS selectors are and how they can be used to target CSS at specific parts of Drupal pages.
Note: This was done using the Fusion Starter theme in Drupal 7 but is applicable to D6 and other "major" themes.
Sorry, the slide animations did not come thru... but only the before and after slide really got effected.
This document outlines the topics that will be covered in the CS 382 Web Technologies course. Key topics include CSS, JavaScript, jQuery, AJAX, JSON, PHP, and web services. Students will complete a project, assignments, midterm and final exam. The course will be 90% practical, focusing on building skills with HTML, CSS, PHP, MySQL, and tools like NetBeans and Photoshop. Styles are defined separately from HTML to control appearance and layout of web pages. Different selectors like element, class, and ID are introduced to target specific styles.
Similar to Charlotte FED - CSS Inheritance and Specificity (20)
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSISTier1 app
Are you ready to unlock the secrets hidden within Java thread dumps? Join us for a hands-on session where we'll delve into effective troubleshooting patterns to swiftly identify the root causes of production problems. Discover the right tools, techniques, and best practices while exploring *real-world case studies of major outages* in Fortune 500 enterprises. Engage in interactive lab exercises where you'll have the opportunity to troubleshoot thread dumps and uncover performance issues firsthand. Join us and become a master of Java thread dump analysis!
Using Query Store in Azure PostgreSQL to Understand Query PerformanceGrant Fritchey
Microsoft has added an excellent new extension in PostgreSQL on their Azure Platform. This session, presented at Posette 2024, covers what Query Store is and the types of information you can get out of it.
Most important New features of Oracle 23c for DBAs and Developers. You can get more idea from my youtube channel video from https://youtu.be/XvL5WtaC20A
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...XfilesPro
Wondering how X-Sign gained popularity in a quick time span? This eSign functionality of XfilesPro DocuPrime has many advancements to offer for Salesforce users. Explore them now!
14 th Edition of International conference on computer visionShulagnaSarkar2
About the event
14th Edition of International conference on computer vision
Computer conferences organized by ScienceFather group. ScienceFather takes the privilege to invite speakers participants students delegates and exhibitors from across the globe to its International Conference on computer conferences to be held in the Various Beautiful cites of the world. computer conferences are a discussion of common Inventions-related issues and additionally trade information share proof thoughts and insight into advanced developments in the science inventions service system. New technology may create many materials and devices with a vast range of applications such as in Science medicine electronics biomaterials energy production and consumer products.
Nomination are Open!! Don't Miss it
Visit: computer.scifat.com
Award Nomination: https://x-i.me/ishnom
Conference Submission: https://x-i.me/anicon
For Enquiry: Computer@scifat.com
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...Paul Brebner
Closing talk for the Performance Engineering track at Community Over Code EU (Bratislava, Slovakia, June 5 2024) https://eu.communityovercode.org/sessions/2024/why-apache-kafka-clusters-are-like-galaxies-and-other-cosmic-kafka-quandaries-explored/ Instaclustr (now part of NetApp) manages 100s of Apache Kafka clusters of many different sizes, for a variety of use cases and customers. For the last 7 years I’ve been focused outwardly on exploring Kafka application development challenges, but recently I decided to look inward and see what I could discover about the performance, scalability and resource characteristics of the Kafka clusters themselves. Using a suite of Performance Engineering techniques, I will reveal some surprising discoveries about cosmic Kafka mysteries in our data centres, related to: cluster sizes and distribution (using Zipf’s Law), horizontal vs. vertical scalability, and predicting Kafka performance using metrics, modelling and regression techniques. These insights are relevant to Kafka developers and operators.
How Can Hiring A Mobile App Development Company Help Your Business Grow?ToXSL Technologies
ToXSL Technologies is an award-winning Mobile App Development Company in Dubai that helps businesses reshape their digital possibilities with custom app services. As a top app development company in Dubai, we offer highly engaging iOS & Android app solutions. https://rb.gy/necdnt
WWDC 2024 Keynote Review: For CocoaCoders AustinPatrick Weigel
Overview of WWDC 2024 Keynote Address.
Covers: Apple Intelligence, iOS18, macOS Sequoia, iPadOS, watchOS, visionOS, and Apple TV+.
Understandable dialogue on Apple TV+
On-device app controlling AI.
Access to ChatGPT with a guest appearance by Chief Data Thief Sam Altman!
App Locking! iPhone Mirroring! And a Calculator!!
Flutter is a popular open source, cross-platform framework developed by Google. In this webinar we'll explore Flutter and its architecture, delve into the Flutter Embedder and Flutter’s Dart language, discover how to leverage Flutter for embedded device development, learn about Automotive Grade Linux (AGL) and its consortium and understand the rationale behind AGL's choice of Flutter for next-gen IVI systems. Don’t miss this opportunity to discover whether Flutter is right for your project.
E-commerce Development Services- Hornet DynamicsHornet Dynamics
For any business hoping to succeed in the digital age, having a strong online presence is crucial. We offer Ecommerce Development Services that are customized according to your business requirements and client preferences, enabling you to create a dynamic, safe, and user-friendly online store.
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsPeter Muessig
The UI5 tooling is the development and build tooling of UI5. It is built in a modular and extensible way so that it can be easily extended by your needs. This session will showcase various tooling extensions which can boost your development experience by far so that you can really work offline, transpile your code in your project to use even newer versions of EcmaScript (than 2022 which is supported right now by the UI5 tooling), consume any npm package of your choice in your project, using different kind of proxies, and even stitching UI5 projects during development together to mimic your target environment.
UI5con 2024 - Bring Your Own Design SystemPeter Muessig
How do you combine the OpenUI5/SAPUI5 programming model with a design system that makes its controls available as Web Components? Since OpenUI5/SAPUI5 1.120, the framework supports the integration of any Web Components. This makes it possible, for example, to natively embed own Web Components of your design system which are created with Stencil. The integration embeds the Web Components in a way that they can be used naturally in XMLViews, like with standard UI5 controls, and can be bound with data binding. Learn how you can also make use of the Web Components base class in OpenUI5/SAPUI5 to also integrate your Web Components and get inspired by the solution to generate a custom UI5 library providing the Web Components control wrappers for the native ones.
A neural network is a machine learning program, or model, that makes decisions in a manner similar to the human brain, by using processes that mimic the way biological neurons work together to identify phenomena, weigh options and arrive at conclusions.
3. Answer:
1)How browsers
determine which CSS
properties to apply
to an element when
multiple,
conflicting rules
are given.
2)The weight given to
each ruleset,
determined by the
selectors given.
4. Is specificity different from inheritance?
Short answer, yes.
Inheritance refers to how child nodes inherit their parent
nodes’ styling, how styling cascades.
Specificity refers to how the browser determines which
styles to apply to an element.
Specificity can come into play in overriding inherited styles, but
child nodes don’t technically inherit the parents’ specificity rules
In other words -- You can use inheritance rules as guidelines
to write selectors, but don’t rely on the parents’
5. But why does this
matter? Anyone can
learn CSS in an hour
Anyone can learn & write CSS
quickly but understanding
specificity matters if:
You work on a large team
with many developers
You are pulled onto a
legacy project
You need to update a theme
(i.e., Shopify,
Wordpress, Squarespace)
You’re working on an open
source project
7. How browsers
work
● Networking layer opens
XHR requests to server
for docs and assets
● UI backend contains
default styles
● HTML and CSS are parsed
by the Rendering Engine
8. How browsers work, cont
● Rendering Engine: Will fetch files in 8KB chunks
● Content Tree: HTML and content parsed first
● Render Tree: Style attributes and CSS parsed, determines
the order of content
● Layout Tree: Node coordinates are calculated
● Paint: The browser’s UI Backend processes the information
from the trees and displays it on the screen
9. How browsers parse CSS
Browsers download CSS files as they’re linked and create
StyleSheet objects which contain rules
The browser traverses the DOM tree, and then traverses all
rulesets in CSS to match the values in class attributes
to selectors in rulesets
Browsers read selectors right to left; the last selector is
called the key selector
10. Making the decision, overview
Browsers take three things into account before applying CSS:
1.Source Order
a.Whichever ruleset comes last will be applied
2.Specificity
a.Whichever ruleset carries greater weight / more specific selectors
will be applied
3.Importance
a.Whichever ruleset is marked as being more important will be applied
11. Making the decision via specificity
The most specific selector: If more than one declaration
applies to the same element, then the most specific
selector wins
I.e., h2.headline will apply over .headline
This also works in overriding inherited styles, i.e., p > .red will
override p.
The most weighted selector: The selector that has the
highest specificity weight will win
I.e., #sidebar { … } weighs more than aside { … }
13. Specificity Weights
Built in rules assign weights to different selectors:
Tag selectors, pseudo-elements: 1 point
I.e., a { … }
Class selectors, attributes, pseudo-classes: 10 points
I.e., .headline { … }
ID selectors: 100 points
I.e., #sidebar
14. Two visuals of calculating specificity
1.Add the weights by 10s 2. Fill in the number of each
selector in its respective 1s, 10s,
etc space to determine the weight
15. Specificity Is Additive
The longer your selector is, the higher the specificity
weight is. Examples:
.sidebar li { … } = 10 + 1 = 11
.sidebar li a { … } = 10 + 1 + 1 = 12
#main-content .sidebar { … } = 100 + 10 = 110
#main-content .sidebar li { … } = 100 + 10 + 1 = 111
And so on...
16.
17. Quick Exercise: How much weight is given?
1.div {}
a.Answer: 1 (1 tag element)
2.ul li {}
a. Answer: 2 (2 tag elements)
3.ul.special-links li a {}
a. Answer: 13 (3 tag elements and 1 class)
4.ul.special-links li a:hover {}
a. Answer: 23 (3 tag elements, 1 class, 1 pseudo-class)
19. What ruleset will win? Example #1
<footer class=“main-footer”>
<a href=“#about-us”
class=“navigation--link site-map--
link”>About Us</a>
</footer>
.main-footer a { color: white }
a.site-map--link { color:
darkblue }
a { color: blue; }
a.navigation--link { color:
skyblue }
Answer: It’ll be sky blue because all the
selectors have the same weight, except for
the tag selector, and the navigation--link is
the last one
20. What ruleset will win? Example #2
<ul>
<li><a href=“#”>Home</a></li>
<li><a href=“#”>Contact</a></li>
</ul>
li > a { color: green; }
li a { color: brown; }
Answer: It will be brown because the
selectors are equal weight; it chooses the
last one. It’s important to note that
combinators such as > and ~ have no weight on
specificity. They’re a part of inheritance
instead, ensuring we only grab the a tags
directly under our li tags, but we don’t
apply the declarations to a tags which are in
divs in li elms
21. What ruleset will win? Example #3
What color will the links be give
this structure?
<aside id="sidebar">
<section id="salads">
<ul>
<li><a href="#">Cobb Salad</a></li>
</ul>
</section>
</aside>
aside#sidebar a {background-
color: yellow; }
aside#sidebar a[href="#"]
{background-color: lightgreen;}
section#salads li a {background-
color: aliceblue;}
Answer:The background will be light green.
This is because attribute selectors have a
specificity weight of 10, thus making it 1 +
100 + 1 + 10 = 112
22. What ruleset will win? Example #4
What color will the text be given
this structure?
<section id=“intro-text”>
<p>Lorem ipsum…</p>
</section>
section#intro-text {color: red
!important;}
p {color: darkgrey;}
Answer: Specificity is not inherited. Since
we’re using the parent element as a selector,
it will apply to the parent element, but
selecting “p” is more specific to the “p” tag
than the parent’s selector. Thus the
paragraph will be grey.
23. What ruleset will win? Example #5
What color will the text be given
this structure, where we apply
.orange-text on the last span?
Hint: We have 11 element selectors
in the first ruleset
html body main section header h2
div span span span span {color:
purple;}
.orange-text {color: orange;}
Answer: 11 beats 10, right? Well...if this
were simply math, but classes will always
beat out elements. That’s the tricky thing
about specificity. Each step up will always
beat out the step beneath it.
24. What ruleset will win? Example #6
<section>
<header>
<h2 style="color: red;"
class="test-important-
text">Test</h2>
</header>
</section>
style="color: red;"
.test-important-text {color:
purple !important;}
Answer: Inline styles are closer to the DOM,
so those should apply, right? In this case,
remember that !important breaks all
specificity rules. It is the only way to
override inline styles. So it will be purple.
26. Simplicity is best
Keep selectors as short and simple as possible to ensure that
stylesheets are:
Easily maintainable, readable, reusable, & intuitive
Easy to onboard (for new developers on the team)
Easy to come back to after months
Not chock full of convoluted rules tripping over each other
*** Use highly specific selectors as the exception, not the
rule, whenever possible
27. Use classes whenever possible
● Element selectors should mainly be used for resets, and
resets should mainly be done to level the browser playing
field
● Element selectors are too general and end up with adding
more rulesets for different styling/conditions
● Multiple resets mean that style rules were applied too
early and are usually the cause of specificity battles
● Classes are more semantic and provide specific intent
○ I.e., the selector .article-title instead of article > header > h2
28. More best CSS practices
● Rulesets should do one thing
○ I.e., .align-left should only float to the left; .slider should only
describe necessary items for slider component (no page layout, etc)
○ This allows you to reuse, mix and match
○ Follows modular approach the web is moving towards
○ Less issues with overwriting rules down the road
● Give classes semantic, intuitive names
○ I.e., .primary-brand-color is better than .dark-blue or using the
color throughout selectors
30. Antipatterns, Pt. I
!important
Reasons:
Breaks specificity rules and is nearly impossible to override
Can result in bugs
Makes it difficult for developers / designers new to the project
IDs
Reasons:
IDs have a specificity weight of 100, making them difficult to
override and impossible to override with classes
31. Antipatterns, Pt. II
Long / unnecessarily specific selectors
Example: body .container .sidebar .links
Reasons:
Adds weight and causes slower processing / paint times as it has to
traverse the DOM to check for an exact match
Adds confusion in terms of readability / maintainability
Violates DRY
Qualified Selectors
33. Resources
Smashing Magazine -- CSS Specificity: Things You Should
Know
Mozilla’s Specificity Docs
Smashing Magazine -- CSS Specificity & Inheritance
How browsers work: Behind the scenes of modern web browsers
Specificity calculator
CSS Wizardry
Intro: Senior UI dev at Cardinal Solutions, BG in product development
Note: This presentation will be more about specificity than inheritance, but it will touch on topics of inheritance in regards to specificity, so it’s still relevant
Also we’ll discuss CSS best practices which will help with inheritance as well
Whether or not you use selectors in CSS has no bearing on whether the child will inherit. It has everything to do with overriding the inheritance by being aware of what kind of selector you need to write
Note: According the Mozilla’s docs: “Styles for a directly targeted element will always take precedence over inherited styles, regardless of the specificity of the inherited rule.”
CSS is simple to grasp, but if you want to work on a project that’s many pages or involves multiple people, then you need to understand how inheritance and specificity work
Understanding specificity will help you minimize bugs and understand why styles aren’t applying -- we’ve all been there
Why does this matter? Because knowing how browsers parse and interpret code allows you to make and justify better decisions and write faster, more efficient code
UI backend -- for form controls, spacing in regards to the box model, etc
Rendering Engine -- Chrome runs multiple instances of it for each tab, adding weight to processing
Render tree -- contains basic styling info like color and the order of content. The layout is applied with the Layout Tree
Paint -- this is where you see a lot of hang up too, especially if a lot of JS is involved in changing CSS styles. This is referred to as jank
Not only does the browser have to download each linked file, opening an XHR request for each one, but it also has to run through the document and make references of the class attributes on HTML elements. It then has to compare those to the CSS declarations to find matches and partial matches. This is why more specific selectors (i.e., descendents) take longer, because instead of having to match only one class, it has to find a match for the entire selector
2) I.e., In the Bison parser, the selector “header nav ul li” a will find the first li item in the DOM tree, traverse up the tree to match every tag to the selector, then traverse all rulesets to find all matching rules. You can see how this gets expensive.
2) Is related to #1 in that h2.headline has more weight (a weight of 11) vs. .headline (a weight of 10)
Note: Specificity doesn’t overwrite entire rulesets with the ruleset that has a higher specificity. It goes on a property by property basis. So if you have a general aside ruleset that gives it a padding of 10px and background-color of light grey, and then decide the .primary-navbar will have a background-color of blue, then the resulting styles applied will be a padding of 10px and a background-color of blue
Note: If you use ID as an attribute, it will have the weight of an attribute (so, 10). This would look like: aside[id=“sidebar”]
Pseudo-classes are things such as: :hover, :active, :disabled (typically describing a state). Note that :first-child, :nth-child are special cases of pseudo-classes called structural pseudo-classes, so it can be tricky. Pseudo-elements are elements that aren’t in the markup but are effectively inserted in the DOM, like ::after, ::before, and ::first-letter
Note on !important: In the case that 2 conflicting rulesets both use !important, the browser will choose the ruleset which has a higher specificity weight.
Also note on !important: This is the only way to override inline styles. So if you can’t touch the HTML and need to override legacy code, here’s your guy
There are use cases where you are able to use !important, but those tend to be when it’s a change that won’t affect the entire website
In some CSS naming conventions, it is recommended to use !important for state/utility styling (i.e., is-hidden)
Also note that !important is utilized in IE8+
1 (1 tag element)
2 (2 tag elements)
13 (3 tag elements and 1 class)
23 (3 tag elements, 1 class, 1 pseudo-class )
13 (3 tag elements, 1 class, negation is 0 )
13 (3 tags, 1 attribute)
11 (1 tag and 1 attribute)
Answer: It’ll be sky blue because all the selectors have the same weight, except for the tag selector, and the navigation--link is the last one
Answer: It will be brown because the selectors are equal weight; it chooses the last one. It’s important to note that combinators such as > and ~ have no weight on specificity. They’re a part of inheritance instead, ensuring we only grab the a tags directly under our li tags, but we don’t apply the declarations to a tags which are in divs in li elms
Note: The universal selector (*) and the negation pseudo-class :not also bear no weight under specificity rules. Also note it can be seen as bad practice for inheritance to use the universal selector, as that can break the rules of inheritance and it’s also a ding in performance
Answer: It might surprise you, but the answer is that the background will be light green! This is because attribute selectors have a specificity weight of 10, thus making it 1 + 100 + 1 + 10 = 112!
Answer: It’s going to be red, right? Wrong! Specificity is not inherited in this case! Since we’re using the parent element as a selector, it will apply to the parent element, but selecting “p” is more specific to the “p” tag than the parent’s selector. Thus the paragraph will be grey!
Answer: 11 beats 10, right? Well...if this were simply math, but classes will always beat out elements. That’s the tricky thing about specificity. Each step up will always beat out the step beneath it.
Answer: Inline styles are closer to the DOM, so those should apply right? Well in this case, remember that !important breaks all specificity rules. It is the only way to override inline styles. So it will be purple.
Another exception is when you really DO want to select every item of that type instead of applying a class to each one. I.e., .main-navigation > li
4) This why BEM is so widely adopted, to help stick to low specificity and allow for use of DRY and minimal resets
Using CSS also ensures that you have an even playing ground with specificity, so you’re not so worried about how it’ll behave.
Note: You really want your code to document itself -- and writing good, semantic CSS is a part of this
Only use !important to override third party stylesheets if you absolutely have to. And even then, it should only be used for page-specific CSS. Don’t use it on site wide CSS or standalone plugins that can be packaged separately
2) On IDs -- they can also be used for JS, but their main purpose is for landmarks and identification of elements; they’re so high in specificity because there’s only one per page
3) Note: The Descendents / Child selectors ARE better than straight up long selectors
Sometimes it’s necessary to use longer selectors or descendents in your selectors; however, if writing from scratch they should be used sparingly and ONLY when you really mean it. If you need one, always go with child selectors.
Note: While SASS is good in many ways, it makes it far too easy for inexperienced devs to follow these antipatterns. You tend to get trigger happy with nesting, but you need to be aware of the generated rulesets and how specific your selectors are. For that reason, I recommend learning the ins and outs of specificity before using SASS heavily