The document provides an introduction to CSS including an overview of what CSS is, why it is used, and its basic syntax and structure. CSS (Cascading Style Sheets) is a stylesheet language used to describe the presentation of structured documents written in HTML or XML. It allows separation of document content from document presentation and formatting. CSS saves development time, makes pages load faster, and allows easier page maintenance.
This document provides an introduction to CSS (Cascading Style Sheets). It defines CSS, explains why it is used, and describes the different ways to implement CSS styles including inline, internal, and external stylesheets. It also covers important CSS concepts like the syntax, selectors, grouping selectors, and comments. CSS is used to control the presentation and layout of HTML elements, separate styling from content, and allow styling to be applied across multiple pages from one stylesheet file.
CSS defines how HTML elements are styled and laid out on a page. There are three main types of CSS: inline CSS using the style attribute, internal CSS using the <style> tag, and external CSS linking to a .css file. CSS selectors like id and class allow targeting specific elements by id or class name to style them. Common CSS properties control elements' color, font, size, positioning, and other visual aspects.
The document provides an overview of Cascading Style Sheets (CSS). CSS allows you to create rules that control the presentation of HTML elements. CSS syntax includes selectors that point to HTML elements and declaration blocks that contain properties and values to style those elements. There are different ways to insert CSS into HTML documents, including external style sheets, internal style sheets, and inline styles. CSS uses the box model to style elements, which includes properties for dimensions, padding, borders, and margins.
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2Erin M. Kidwell
The document provides instructions for downloading Aptana Studio and provides a brandery airport code. It includes the following information:
1. It instructs readers to download Aptana Studio from the provided URL if they have not already done so.
2. It provides a brandery airport code of "brandery123".
3. The document does not contain any other information.
CSS (Cascading Style Sheets) is a style sheet language used to describe the presentation of HTML documents, including how elements should be rendered on screen, on paper, in speech, or on other media. CSS saves time because styles defined in CSS files can be reused across multiple HTML pages. It provides more control over formatting than HTML alone and helps separate a document's content from its presentation. The document then explains various CSS concepts like selectors, properties, syntax, and how to apply styles using internal, external and inline CSS.
CSS (Cascading Style Sheets) allows control over how HTML elements are displayed on different media. CSS saves work by allowing global control of layout and styles across multiple web pages from a single stylesheet. It provides advantages like faster page loads, easy maintenance through global changes, superior styling capabilities, and compatibility across devices. CSS is created and maintained by the W3C consortium and browser vendors implement CSS specifications. Styles are applied using selectors that target elements by name, id, class, and other attributes. Styles can be defined internally, in external style sheets, or inline in elements.
This document provides an introduction and overview of Cascading Style Sheets (CSS). It discusses using CSS to control the appearance of websites by separating content from presentation. It describes various methods for including CSS with HTML, including inline styles, embedded style sheets within <style> tags, and external CSS files linked via <link> tags. Key CSS concepts covered include selectors, the CSS syntax of rules and declarations, and using type, class, ID and other selectors to target specific elements. Maintaining styles in external CSS files is presented as the preferred approach for organization and maintenance.
Cascading Style Sheets (CSS) allow control over the appearance of web pages by separating presentation from content. CSS is used to create consistent styles across multiple pages by defining styles that can be applied using classes and IDs. CSS rules define selectors and properties to style HTML elements, and separating styles from HTML structure makes pages easier to maintain and modify. Common CSS selectors include element, class, ID, and contextual selectors. Styles can be linked to HTML using inline, embedded, and external stylesheets.
This document provides an introduction to CSS (Cascading Style Sheets) including:
- CSS allows separation of document content from design and formatting through stylesheets.
- Stylesheets define how HTML elements are displayed and can be internal, external, or inline.
- Multiple stylesheets and style definitions will cascade together based on specificity.
- The CSS syntax uses selectors to target elements and properties to define styles like colors, fonts, spacing.
- Comments, classes, IDs, and other selectors provide control over styling different elements.
Cascading Style Sheets (CSS) is a style sheet language used to describe the presentation of HTML documents. CSS describes how HTML elements are displayed on screen, paper, or other media. CSS saves work by allowing control of layout and presentation for multiple web pages from one stylesheet file. CSS solves the problem of formatting documents that originally arose from adding font tags and other styling attributes directly into HTML.
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.
CSS (Cascading Style Sheets) allows styling and formatting of HTML documents. It provides greater typography and layout controls and easier site maintenance through separation of design (CSS files) from content (HTML files). CSS selectors target specific elements to change properties like colors, backgrounds, fonts etc. Styles can be defined internally, in a separate external CSS file, or inline within elements. Classes allow targeting elements with the same styling. Common CSS properties control text, backgrounds, fonts and other visual aspects of HTML elements.
Intro to HTML and CSS - Class 2 SlidesHeather Rock
1. CSS stands for Cascading Style Sheets and refers to how styles are applied hierarchically to HTML elements.
2. There are three main ways to attach CSS to a webpage: inline, embedded, and linked. Linked style sheets keep the styles in a separate .css file for easy maintenance.
3. CSS selectors allow targeting specific elements by HTML tag names, classes, IDs, and other attributes. Common selectors include colors, fonts, links, and compound selectors.
This document provides an overview of CSS (Cascading Style Sheets) including definitions, advantages, properties and techniques. It defines CSS as defining how HTML elements are displayed and styles being stored in style sheets. Advantages of CSS include reduced code/page size, easier design/maintenance. Style rules define how to change default element behaviors and have selectors and declarations. External style sheets can apply styles across pages by linking via <LINK>. CSS selection techniques include selecting multiple elements, by context, with classes, <DIV> and <SPAN>. Font properties that can be controlled include family, size, weight, line height and color.
Make Css easy(part:2) : easy tips for css(part:2)shabab shihan
This slideshow presentation is designed to introduce you to Cascading Style Sheets (CSS). It is the first of two CSS workshops available. In addition to the two CSS workshops, there are also workshops on HTML, PHP, and MySQL.
Cascading Style Sheets (CSS) is used to describe the presentation of HTML documents including defining sizes, spacing, fonts, colors, layout, etc. CSS separates presentation from content to improve accessibility, flexibility and reusability. There are different ways to apply CSS including inline styles within HTML elements, internal styles within the <style> tag, and external stylesheets linked via the <link> tag. Key benefits of CSS include faster page loads, increased accessibility, and easier maintenance of page styling across many pages by changing a single CSS file.
CSS (Cascading Style Sheets) allows separation of document content from document presentation, including elements like fonts, colors, and layout. CSS saves work by defining styles that can be applied to multiple pages from a single .css file. CSS rules contain selectors that specify elements to style and declarations that define element properties like color, font, size and more. Common CSS selectors include element, class, and ID selectors. The CSS box model, background properties, borders, text properties and grouping/nesting allow precise control of appearance.
This document provides an overview of Cascading Style Sheets (CSS) including what CSS is, how to write CSS code, and the different ways to include CSS in an HTML document. CSS allows separation of document content from page layout and visual design. CSS code uses selectors, properties, and values to style HTML elements. Styles can be included inline, internally in the <head> using <style> tags, or externally in a .css file linked via the <link> tag. Inheritance rules determine which styles take precedence.
The basic of css for all.
Separates structure from presentation
Provides advanced control of presentation
Easy maintenance of multiple pages
Faster Page loading
Better accessibility for disabled users
Easy to learn
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
Risk Analysis 101: Using a Risk Analyst to Fortify Your IT Strategyjohn823664
Discover how a minor IT glitch became the catalyst for a major strategic shift. In this real-world story, follow Emma, a CTO at a fast-growing managed service provider, as she faces a critical data backup failure—and turns to a risk analyst from remoting.work to transform chaos into clarity.
This presentation breaks down the essentials of IT risk analysis and shows how SMBs can proactively manage cyber threats, regulatory gaps, and infrastructure vulnerabilities. Learn what a remote risk analyst really does, why structured risk management matters, and how remoting.work delivers vetted experts without the overhead of full-time hires.
Perfect for CTOs, IT managers, and business owners ready to future-proof their IT strategy.
👉 Visit remoting.work to schedule your free risk assessment today.
Engaging interactive session at the Carolina TEC Conference—had a great time presenting the intersection of AI and hybrid cloud, and discussing the exciting momentum the #HashiCorp acquisition brings to #IBM."
Ad
More Related Content
Similar to Learning CSS for beginners.ppt all that are but (20)
This document provides an introduction and overview of Cascading Style Sheets (CSS). It discusses using CSS to control the appearance of websites by separating content from presentation. It describes various methods for including CSS with HTML, including inline styles, embedded style sheets within <style> tags, and external CSS files linked via <link> tags. Key CSS concepts covered include selectors, the CSS syntax of rules and declarations, and using type, class, ID and other selectors to target specific elements. Maintaining styles in external CSS files is presented as the preferred approach for organization and maintenance.
Cascading Style Sheets (CSS) allow control over the appearance of web pages by separating presentation from content. CSS is used to create consistent styles across multiple pages by defining styles that can be applied using classes and IDs. CSS rules define selectors and properties to style HTML elements, and separating styles from HTML structure makes pages easier to maintain and modify. Common CSS selectors include element, class, ID, and contextual selectors. Styles can be linked to HTML using inline, embedded, and external stylesheets.
This document provides an introduction to CSS (Cascading Style Sheets) including:
- CSS allows separation of document content from design and formatting through stylesheets.
- Stylesheets define how HTML elements are displayed and can be internal, external, or inline.
- Multiple stylesheets and style definitions will cascade together based on specificity.
- The CSS syntax uses selectors to target elements and properties to define styles like colors, fonts, spacing.
- Comments, classes, IDs, and other selectors provide control over styling different elements.
Cascading Style Sheets (CSS) is a style sheet language used to describe the presentation of HTML documents. CSS describes how HTML elements are displayed on screen, paper, or other media. CSS saves work by allowing control of layout and presentation for multiple web pages from one stylesheet file. CSS solves the problem of formatting documents that originally arose from adding font tags and other styling attributes directly into HTML.
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.
CSS (Cascading Style Sheets) allows styling and formatting of HTML documents. It provides greater typography and layout controls and easier site maintenance through separation of design (CSS files) from content (HTML files). CSS selectors target specific elements to change properties like colors, backgrounds, fonts etc. Styles can be defined internally, in a separate external CSS file, or inline within elements. Classes allow targeting elements with the same styling. Common CSS properties control text, backgrounds, fonts and other visual aspects of HTML elements.
Intro to HTML and CSS - Class 2 SlidesHeather Rock
1. CSS stands for Cascading Style Sheets and refers to how styles are applied hierarchically to HTML elements.
2. There are three main ways to attach CSS to a webpage: inline, embedded, and linked. Linked style sheets keep the styles in a separate .css file for easy maintenance.
3. CSS selectors allow targeting specific elements by HTML tag names, classes, IDs, and other attributes. Common selectors include colors, fonts, links, and compound selectors.
This document provides an overview of CSS (Cascading Style Sheets) including definitions, advantages, properties and techniques. It defines CSS as defining how HTML elements are displayed and styles being stored in style sheets. Advantages of CSS include reduced code/page size, easier design/maintenance. Style rules define how to change default element behaviors and have selectors and declarations. External style sheets can apply styles across pages by linking via <LINK>. CSS selection techniques include selecting multiple elements, by context, with classes, <DIV> and <SPAN>. Font properties that can be controlled include family, size, weight, line height and color.
Make Css easy(part:2) : easy tips for css(part:2)shabab shihan
This slideshow presentation is designed to introduce you to Cascading Style Sheets (CSS). It is the first of two CSS workshops available. In addition to the two CSS workshops, there are also workshops on HTML, PHP, and MySQL.
Cascading Style Sheets (CSS) is used to describe the presentation of HTML documents including defining sizes, spacing, fonts, colors, layout, etc. CSS separates presentation from content to improve accessibility, flexibility and reusability. There are different ways to apply CSS including inline styles within HTML elements, internal styles within the <style> tag, and external stylesheets linked via the <link> tag. Key benefits of CSS include faster page loads, increased accessibility, and easier maintenance of page styling across many pages by changing a single CSS file.
CSS (Cascading Style Sheets) allows separation of document content from document presentation, including elements like fonts, colors, and layout. CSS saves work by defining styles that can be applied to multiple pages from a single .css file. CSS rules contain selectors that specify elements to style and declarations that define element properties like color, font, size and more. Common CSS selectors include element, class, and ID selectors. The CSS box model, background properties, borders, text properties and grouping/nesting allow precise control of appearance.
This document provides an overview of Cascading Style Sheets (CSS) including what CSS is, how to write CSS code, and the different ways to include CSS in an HTML document. CSS allows separation of document content from page layout and visual design. CSS code uses selectors, properties, and values to style HTML elements. Styles can be included inline, internally in the <head> using <style> tags, or externally in a .css file linked via the <link> tag. Inheritance rules determine which styles take precedence.
The basic of css for all.
Separates structure from presentation
Provides advanced control of presentation
Easy maintenance of multiple pages
Faster Page loading
Better accessibility for disabled users
Easy to learn
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
Risk Analysis 101: Using a Risk Analyst to Fortify Your IT Strategyjohn823664
Discover how a minor IT glitch became the catalyst for a major strategic shift. In this real-world story, follow Emma, a CTO at a fast-growing managed service provider, as she faces a critical data backup failure—and turns to a risk analyst from remoting.work to transform chaos into clarity.
This presentation breaks down the essentials of IT risk analysis and shows how SMBs can proactively manage cyber threats, regulatory gaps, and infrastructure vulnerabilities. Learn what a remote risk analyst really does, why structured risk management matters, and how remoting.work delivers vetted experts without the overhead of full-time hires.
Perfect for CTOs, IT managers, and business owners ready to future-proof their IT strategy.
👉 Visit remoting.work to schedule your free risk assessment today.
Engaging interactive session at the Carolina TEC Conference—had a great time presenting the intersection of AI and hybrid cloud, and discussing the exciting momentum the #HashiCorp acquisition brings to #IBM."
Harmonizing Multi-Agent Intelligence | Open Data Science Conference | Gary Ar...Gary Arora
This deck from my talk at the Open Data Science Conference explores how multi-agent AI systems can be used to solve practical, everyday problems — and how those same patterns scale to enterprise-grade workflows.
I cover the evolution of AI agents, when (and when not) to use multi-agent architectures, and how to design, orchestrate, and operationalize agentic systems for real impact. The presentation includes two live demos: one that books flights by checking my calendar, and another showcasing a tiny local visual language model for efficient multimodal tasks.
Key themes include:
✅ When to use single-agent vs. multi-agent setups
✅ How to define agent roles, memory, and coordination
✅ Using small/local models for performance and cost control
✅ Building scalable, reusable agent architectures
✅ Why personal use cases are the best way to learn before deploying to the enterprise
RFID (Radio Frequency Identification) is a technology that uses radio waves to
automatically identify and track objects, such as products, pallets, or containers, in the supply chain.
In supply chain management, RFID is used to monitor the movement of goods
at every stage — from manufacturing to warehousing to distribution to retail.
For this products/packages/pallets are tagged with RFID tags and RFID readers,
antennas and RFID gate systems are deployed throughout the warehouse
Slack like a pro: strategies for 10x engineering teamsNacho Cougil
You know Slack, right? It's that tool that some of us have known for the amount of "noise" it generates per second (and that many of us mute as soon as we install it 😅).
But, do you really know it? Do you know how to use it to get the most out of it? Are you sure 🤔? Are you tired of the amount of messages you have to reply to? Are you worried about the hundred conversations you have open? Or are you unaware of changes in projects relevant to your team? Would you like to automate tasks but don't know how to do so?
In this session, I'll try to share how using Slack can help you to be more productive, not only for you but for your colleagues and how that can help you to be much more efficient... and live more relaxed 😉.
If you thought that our work was based (only) on writing code, ... I'm sorry to tell you, but the truth is that it's not 😅. What's more, in the fast-paced world we live in, where so many things change at an accelerated speed, communication is key, and if you use Slack, you should learn to make the most of it.
---
Presentation shared at JCON Europe '25
Feedback form:
http://tiny.cc/slack-like-a-pro-feedback
Building a research repository that works by Clare CadyUXPA Boston
Are you constantly answering, "Hey, have we done any research on...?" It’s a familiar question for UX professionals and researchers, and the answer often involves sifting through years of archives or risking lost insights due to team turnover.
Join a deep dive into building a UX research repository that not only stores your data but makes it accessible, actionable, and sustainable. Learn how our UX research team tackled years of disparate data by leveraging an AI tool to create a centralized, searchable repository that serves the entire organization.
This session will guide you through tool selection, safeguarding intellectual property, training AI models to deliver accurate and actionable results, and empowering your team to confidently use this tool. Are you ready to transform your UX research process? Attend this session and take the first step toward developing a UX repository that empowers your team and strengthens design outcomes across your organization.
This guide highlights the best 10 free AI character chat platforms available today, covering a range of options from emotionally intelligent companions to adult-focused AI chats. Each platform brings something unique—whether it's romantic interactions, fantasy roleplay, or explicit content—tailored to different user preferences. From Soulmaite’s personalized 18+ characters and Sugarlab AI’s NSFW tools, to creative storytelling in AI Dungeon and visual chats in Dreamily, this list offers a diverse mix of experiences. Whether you're seeking connection, entertainment, or adult fantasy, these AI platforms provide a private and customizable way to engage with virtual characters for free.
This presentation dives into how artificial intelligence has reshaped Google's search results, significantly altering effective SEO strategies. Audiences will discover practical steps to adapt to these critical changes.
https://www.fulcrumconcepts.com/ai-killed-the-seo-star-2025-version/
Digital Technologies for Culture, Arts and Heritage: Insights from Interdisci...Vasileios Komianos
Keynote speech at 3rd Asia-Europe Conference on Applied Information Technology 2025 (AETECH), titled “Digital Technologies for Culture, Arts and Heritage: Insights from Interdisciplinary Research and Practice". The presentation draws on a series of projects, exploring how technologies such as XR, 3D reconstruction, and large language models can shape the future of heritage interpretation, exhibition design, and audience participation — from virtual restorations to inclusive digital storytelling.
UiPath AgentHack - Build the AI agents of tomorrow_Enablement 1.pptxanabulhac
Join our first UiPath AgentHack enablement session with the UiPath team to learn more about the upcoming AgentHack! Explore some of the things you'll want to think about as you prepare your entry. Ask your questions.
Bridging AI and Human Expertise: Designing for Trust and Adoption in Expert S...UXPA Boston
AI and Machine Learning are transforming expert systems, augmenting human decision-making in fields ranging from finance and healthcare to manufacturing and supply chain. But for AI to be truly effective, experts must trust and adopt these systems. This talk explores how UX practitioners can bridge the gap between AI’s computational power and human expertise.
We'll discuss key challenges, including designing for trust, working with the limits of explainability, and ensuring adoption through user-centered strategies. Attendees will gain practical insights into how to craft AI-driven experiences that experts rely on with confidence, ensuring these systems enhance rather than hinder decision-making.
Developing Product-Behavior Fit: UX Research in Product Development by Krysta...UXPA Boston
What if product-market fit isn't enough?
We’ve all encountered companies willing to spend time and resources on product-market fit, since any solution needs to solve a problem for people able and willing to pay to solve that problem, but assuming that user experience can be “added” later.
Similarly, value proposition-what a solution does and why it’s better than what’s already there-has a valued place in product development, but it assumes that the product will automatically be something that people can use successfully, or that an MVP can be transformed into something that people can be successful with after the fact. This can require expensive rework, and sometimes stops product development entirely; again, UX professionals are deeply familiar with this problem.
Solutions with solid product-behavior fit, on the other hand, ask people to do tasks that they are willing and equipped to do successfully, from purchasing to using to supervising. Framing research as developing product-behavior fit implicitly positions it as overlapping with product-market fit development and supports articulating the cost of neglecting, and ROI on supporting, user experience.
In this talk, I’ll introduce product-behavior fit as a concept and a process and walk through the steps of improving product-behavior fit, how it integrates with product-market fit development, and how they can be modified for products at different stages in development, as well as how this framing can articulate the ROI of developing user experience in a product development context.
Crazy Incentives and How They Kill Security. How Do You Turn the Wheel?Christian Folini
Everybody is driven by incentives. Good incentives persuade us to do the right thing and patch our servers. Bad incentives make us eat unhealthy food and follow stupid security practices.
There is a huge resource problem in IT, especially in the IT security industry. Therefore, you would expect people to pay attention to the existing incentives and the ones they create with their budget allocation, their awareness training, their security reports, etc.
But reality paints a different picture: Bad incentives all around! We see insane security practices eating valuable time and online training annoying corporate users.
But it's even worse. I've come across incentives that lure companies into creating bad products, and I've seen companies create products that incentivize their customers to waste their time.
It takes people like you and me to say "NO" and stand up for real security!
Whose choice? Making decisions with and about Artificial Intelligence, Keele ...Alan Dix
Invited talk at Designing for People: AI and the Benefits of Human-Centred Digital Products, Digital & AI Revolution week, Keele University, 14th May 2025
https://www.alandix.com/academic/talks/Keele-2025/
In many areas it already seems that AI is in charge, from choosing drivers for a ride, to choosing targets for rocket attacks. None are without a level of human oversight: in some cases the overarching rules are set by humans, in others humans rubber-stamp opaque outcomes of unfathomable systems. Can we design ways for humans and AI to work together that retain essential human autonomy and responsibility, whilst also allowing AI to work to its full potential? These choices are critical as AI is increasingly part of life or death decisions, from diagnosis in healthcare ro autonomous vehicles on highways, furthermore issues of bias and privacy challenge the fairness of society overall and personal sovereignty of our own data. This talk will build on long-term work on AI & HCI and more recent work funded by EU TANGO and SoBigData++ projects. It will discuss some of the ways HCI can help create situations where humans can work effectively alongside AI, and also where AI might help designers create more effective HCI.
Scientific Large Language Models in Multi-Modal Domainssyedanidakhader1
The scientific community is witnessing a revolution with the application of large language models (LLMs) to specialized scientific domains. This project explores the landscape of scientific LLMs and their impact across various fields including mathematics, physics, chemistry, biology, medicine, and environmental science.
Google DeepMind’s New AI Coding Agent AlphaEvolve.pdfderrickjswork
In a landmark announcement, Google DeepMind has launched AlphaEvolve, a next-generation autonomous AI coding agent that pushes the boundaries of what artificial intelligence can achieve in software development. Drawing upon its legacy of AI breakthroughs like AlphaGo, AlphaFold and AlphaZero, DeepMind has introduced a system designed to revolutionize the entire programming lifecycle from code creation and debugging to performance optimization and deployment.
2. What is CSS?
• CSS stands for Cascading Style Sheets
• A specification for the presentation of HTML documents.
Like a template; used to define a style for an HTML
element and then applied across one or more Web pages.
• Provides the ability to separate the layout and styles of a
web page from the data or information. Styles such as
fonts, font sizes, letter spacing, colors, borders, and
margins, can be specified in one place.
4. Traditional Markup vs. CSS
Traditional
HTML mixes
presentation
with data
CSS
separates
content from
presentation,
making it
much easier
to manage
both data and
design!
5. Why CSS?
• Imagine you manage a site with 100+ pages. The boss
wants you to change the font of all headings, which appear
an average of five places per page. Once you’ve done it,
he changes his mind. Now imagine the site has 10,000
pages.
• CSS lets us change a single entry to make immediate
changes.
6. Cascading?
• Cascading means that the style definitions flow
down into the nested tags.
– Ex. Applying the color red to the <body> element will
cascade down through other elements like <p>
7. How is CSS implemented?
• CSS can be written for different media (screen, printer,
etc), can be included in an HTML document, or can be a
separate file that is applied to multiple HTML documents.
• Styles can be external, internal, or inline.
– What are the benefits of a separate file vs.
internal/inline?
• We will focus on external style sheets
8. • Inline style has the highest priority and will override all others
• The style applies only to the HTML element in which it is declared
9. Internal styles
• They are placed in the <HEAD> section and apply to all elements of a
certain type
• <HEAD>
• <STYLE type = “text/css”>
• H1 {color: blue; font-size: 20pt}
• H2 {color: red; font-family: Arial, sans-serif}
• </STYLE>
• The above CSS – “rules” are applied to all H1 and H2 elements in the
document
10. Implementing CSS
• First step, write good, well-formed HTML without modifiers.
Use only generic tags like <h1>, <p>, etc.
• Inside the <head> section, add:
<link href="file.css" rel="stylesheet" type="text/css" />
• Create a text file (named with a .css extension)
• Populate the new CSS file with CSS selectors and styles!
11. Parts of the CSS File
h1 {
color: blue
font-size: 18px;
}
Selector Properties
•The selector is defined by the style (made up of properties).
•All content wrapped in <h1> tags throughout the pages
where the CSS file is linked will be blue and 18 pixels tall.
Style
12. Basic Syntax
• Selector: Can be any HTML element. The Selector
is simply the tag element linked to a style.
– Example
p { color:red; }
‘p’ is the selector. All text wrapped with the <p> tag will be
colored red
14. New-School: Before CSS
<html>
<head>
<title>New School</title>
</head>
<body>
<h1>Example Head</h1>
<p>Main text here.</p>
<h1>Another Head</h1>
<p>More text here.</p>
</body>
</html>
Note the change from
<font> tags in the Old-
School example to the
<h1> tags, as well as
the elimination of the
<font> tags that were
nested inside the <p>
tags.
15. New-School: With CSS
<html>
<head>
<title>New School with CSS</title>
<link href="style.css" rel="stylesheet"
type="text/css" />
</head>
<body>
<h1>Example Head</h1>
<p>Main text here.</p>
<h1>Another Head</h1>
<p>More text here.</p>
</body>
</html>
Note the addition of the
<link> tag, which links in
our style sheet.
16. Selectors: Classes
• We can create classes, which are a named subset
of a tag.
p {
font-family: Tahoma, Helvetica;
color: red;
}
p.quote {
font-family: Tahoma, Helvetica;
color: green;
}
Defines the <p> tag
Defines a class of
the <p> tag called
quote.
17. Selectors: Classes
• A Class selector can be created without a tag,
making it available to any element.
.corrected {
font-style: italic;
text-transform: capitalize;
color: #666699;
text-decoration: line-through;
}
Defines a class of
the <p> tag called
corrected.
18. Selectors: ID
• An ID selector is intended for single-use.
• Should be used sparingly, since it defines a single
instance of “something”.
#X57 {
letter-spacing: 0.3em
}
Increases letter
spacing for an
element that uses
the id=X57 attribute
19. Selectors: Contextual
• Contextual selectors are made up of two or more selectors
separated by white space.
• They take precedence over simple selectors.
• This contextual selector draws <em> text in a <p> with a
yellow background; <em> text elsewhere would be
unaffected.
p em {
background: yellow;
}
20. Selectors: Pseudo Classes
• Define the state of certain selectors, such as the <a> tag’s link,
hover, visited and active states.
a:link {
color: black;
}
a:hover {
color: blue;
font-size: 125%;
}
a:visited {
color: green;
font-weight: bold;
}
Defines the link state
of the <a> tag
Defines the visited
state of the <a> tag
Defines the hover
state of the <a> tag
21. Selectors: Pseudo Elements
Special capabilities of the <p> selector:
p:first-line {
font-variant: small-caps;
}
p:first-letter {
font-size: 300%;
float: left
}
First line of <p> will be
in small caps
First letter of <p> will
be large
23. • CLASSES
• Class declarations are preceded by a period and apply to all elements of the class:
• <STYLE>
• .highlight {color: red; font-style: italic}
• </STYLE>
• <BODY>
• <P class= “highlight”>……..</P>
•
• ELEMENTS
• Elements are declared starting with # and are applied to only one element referenced by an ID
•
24. • NB:
• Two types of paragraphs in your document:
• One is right aligned paragraph
• The other is center aligned paragraph
• How to do it with styles?
• Solution: Use class selector
• <STYLE>
• p.right {text-align: right}
• Class
• Tag/element name which is optional
• <p.center { text-align: center}
• </STYLE>
• Now use the class attribute in your HTML document as:
• <p class = “right”>
• Right aligned paragraph
• <p class = “center”>
• Center aligned paragraph
• </p>
•
• NB: Only one class can be specified per HTML document
• <STYLE>
• #name {text aligned: center}
• </STYLE>
• <BODY>
• <H1 ID = “name”>