TOPIC 1 (MIDTERM) Flashcards
is a language that describes the style of an HTML document. It describes how HTML elements should be displayed
Cascading Style Sheets (CSS)
It handles the look and feel part of a web page. Using this, 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, layout designs, variations in display for different devices and screen sizes as well as a variety of other effects.
Cascading Style Sheets (CSS)
It is easy to learn and understand but it provides powerful control over the presentation of an HTML document.
Cascading Style Sheets (CSS)
Most commonly, It is combined with the markup languages HTML or XHTML.
Cascading Style Sheets (CSS)
He invented CSS on October 10, 1994 and maintained through a group of people within the W3C called the CSS Working Group.
Hakon Wium Lie
He is a Norwegian web pioneer, a standards activist, and the Chief Technology Officer of Opera Software from 1998 until the browser was sold to new owners in 2016.
Hakon Wium Lie
He is best known for developing Cascading Style Sheets while working with Tim Berners-Lee and Robert Cailliau at CERN in 1994.
Hakon Wium Lie
What are the advantages of css
CSS Saves Time
Pages Load Faster
Easy Maintenance
Superior Styles to HTML
Offline Browsing
Platform Independence
You can write CSS once and then reuse same sheet in multiple HTML pages. You can define a style for each HTML element and apply it to as many Web pages as you want.
CSS Saves Time
If you are using CSS, you do not need to write HTML tag attributes every time. Just write one CSS rule of a tag and apply it to all the occurrences of that tag. So less code means faster download times.
Pages Load Faster
To make a global change, simply change the style, and all elements in all the web pages will be updated automatically.
Easy Maintenance
CSS has a much wider array of attributes than HTML, so you can give a far better look to your HTML page in comparison to HTML attributes.
Superior Styles to HTML
CSS can store web applications locally with the help of an offline cache. Using of this, we can view offline websites. The cache also ensures faster loading and better overall performance of the website.
Offline Browsing
The Script offer consistent ________ and can support latest browsers as well
Platform Independence
What are the CSS versions
CSS 1
CSS 2
CSS 3
was came out of W3C as a recommendation in December 1996. This version describes the CSS language as well as a simple visual formatting model for all the HTML tags.
CSS 1
was became a W3C recommendation in May 1998 and builds on CSS1. This version adds support for media-specific style sheets e.g. printers and aural devices, downloadable fonts, element positioning and tables.
CSS 2
was became a W3C recommendation in June 1999 and builds on older versions CSS. it has divided into documentations is called as Modules and here each module having new extension features defined in CSS2.
CSS 3
it is an HTML tag at which a style will be applied. This could be any tag like < h1 > or < table > etc.
Selector
It is a type of attribute of HTML tag. Put simply, all the HTML attributes are converted into CSS properties. They could be color, border etc.
Property
These are assigned to properties. For example, color property can have value either red or #F1F1F1 etc
Value
It may be used to apply a unique style for a single element. To use ________, add the style attribute to the relevant element. The style________ can contain any CSS property.
Inline CSS
It may be used if one single HTML page has a unique style. The ________ is defined inside the < style > element, inside the head section.
Internal CSS
you can change the look of an entire website by changing just one file! Each HTML page must include a reference to the external style sheet file inside the element, inside the head section. It can be written in any text editor, and must be saved with a .css extension. The external .css file should not contain any HTML tags.
External CSS
What are the 3 ways to insert css in an html page
Inline CSS
Internal CSS
External CSS
involves using CSS (Cascading Style Sheets) to enhance the visual presentation of HTML elements. You can specify the style of the elements using the different selectors that are used in CSS.
CSS Style Specificcation
The p tag is initially styled to have blue text. The second rule uses !important to ensure the text color is red, overriding the first rule regardless of its order.
CSS !important
in CSS allow you to target specific elements based on various criteria
Selector Patterns
(*) targets all elements on the page.
Universal Selector
targets elements of a specific type.
Type Selector
selects elements with a specific class attribute. To select elements with a specific class, write a period (.) character, followed by the name of the class. You can also specify that only specific HTML elements should be affected by a class
Class Selector
uses the id attribute of an HTML element to select a specific element. The id of an element should be unique within a page, so the id selector is used to select one unique element! To select an element with a specific id, write a hash (#) character, followed by the id of the element. The style rule below will be applied to the HTML element sample
ID Selector
targets an element that is a descendant of another element.
Descendant Selector
styles only direct child elements
Child Selector (>)
targets an element that is a direct child of another element.
Adjacent Sibling Selector
targets elements based on the presence or value of their attributes.
Attributes Selector
allows you to apply the same style to multiple elements by separating their selectors with a comma (,). This is useful when you want to apply the same style to different types of elements without repeating the code for each selector.
Multiple Selector
The more specific a selector is, the higher its precedence. IDs have higher specificity than classes or tag selectors.
Specify
Styles marked with !important have the highest precedence
importance
Styles defined later in the document take precedence over earlier ones.
Order of Appearance
refers to the way styles are passed down from a parent element to its child elements in the HTML document. Not all styles are inherited; some are explicitly applied only to the element they are defined for. However, many properties are inherited by default.
Style Inheritance
are used to explain the code, and may help when you edit the source code at a later date.
Comments /* */
These are ignored by browsers.
Comments /* */
It starts with /* and ends with */. It can also span multiple lines
Comments
plays a crucial role in the visual appeal of a website, experimenting with different color options can help a developer achieve the desired look and feel of the webpage
Colors
provide a convenient way to use predefined color values in CSS
Color Names
define colors using a combination of red, green, and blue components
RGB Color Value
represent colors using hexadecimal notation
Hex Color Value
you can use the rgba function for RGB values or hexa for HEX values
Semi-Opaque Colors
consist of properties and values, defining styling rules.
Declaration
contains one or more declarations, separated by semicolons
Declaration Block