Podcast
Questions and Answers
What is the purpose of using CSS in web design?
What is the purpose of using CSS in web design?
- To store data in databases
- To create server-side applications
- To apply consistent styling across multiple webpages (correct)
- To add interactivity to web pages
CSS styles can only be applied to a single webpage and not across multiple pages.
CSS styles can only be applied to a single webpage and not across multiple pages.
False (B)
What tag is used to enclose a part of the text that is to be styled?
What tag is used to enclose a part of the text that is to be styled?
span
CSS can be embedded in the ______ section of the webpage.
CSS can be embedded in the ______ section of the webpage.
Match the following CSS-related terms with their descriptions:
Match the following CSS-related terms with their descriptions:
What is the primary function of HTML in web development?
What is the primary function of HTML in web development?
CSS is primarily used to add content to webpages.
CSS is primarily used to add content to webpages.
Name one type of media that can be displayed on a webpage.
Name one type of media that can be displayed on a webpage.
A webpage contains text marked up with __________ tags.
A webpage contains text marked up with __________ tags.
Match the following elements with their function in web development:
Match the following elements with their function in web development:
Which version of HTML is mentioned in the content?
Which version of HTML is mentioned in the content?
Web browsers can only display text and images.
Web browsers can only display text and images.
What is the primary function of lists in HTML?
What is the primary function of lists in HTML?
An unordered list in HTML displays items with automatic numbering.
An unordered list in HTML displays items with automatic numbering.
What are the two types of lists defined in HTML?
What are the two types of lists defined in HTML?
The HTML code for an unordered list begins with <> and ends with </>.
The HTML code for an unordered list begins with <> and ends with </>.
Match the following types of lists with their characteristics:
Match the following types of lists with their characteristics:
Which statement best describes the ease of using lists in HTML?
Which statement best describes the ease of using lists in HTML?
HTML line breaks directly correspond to how text appears in browsers.
HTML line breaks directly correspond to how text appears in browsers.
What does the 'li' tag represent in HTML lists?
What does the 'li' tag represent in HTML lists?
The code example for an unordered list is found in the file named <_____>.html.
The code example for an unordered list is found in the file named <_____>.html.
What does the alt attribute in an img tag do?
What does the alt attribute in an img tag do?
The img tag requires a closing tag.
The img tag requires a closing tag.
What can visually impaired users utilize to understand an image when using the alt attribute?
What can visually impaired users utilize to understand an image when using the alt attribute?
The img tag is used to display an image on a ______.
The img tag is used to display an image on a ______.
Match the following HTML tags with their functions:
Match the following HTML tags with their functions:
What will happen if an image cannot be displayed?
What will happen if an image cannot be displayed?
The img tag is an example of a block-level element.
The img tag is an example of a block-level element.
Name an example of an empty element in HTML.
Name an example of an empty element in HTML.
HTML elements that do not require an end tag are called ______ elements.
HTML elements that do not require an end tag are called ______ elements.
Which of the following is NOT an example of an empty element?
Which of the following is NOT an example of an empty element?
What type of URL contains the full path to a resource?
What type of URL contains the full path to a resource?
A relative URL specifies the location of a file relative to the current file's folder structure.
A relative URL specifies the location of a file relative to the current file's folder structure.
What is the purpose of character entities in HTML?
What is the purpose of character entities in HTML?
The symbol for a non-breaking space in HTML is represented by the entity name __________.
The symbol for a non-breaking space in HTML is represented by the entity name __________.
Match the following URLs with their descriptions:
Match the following URLs with their descriptions:
Which of the following is NOT a reason to use CSS?
Which of the following is NOT a reason to use CSS?
HTML entities can only be used for displaying mathematical symbols.
HTML entities can only be used for displaying mathematical symbols.
What does CSS stand for?
What does CSS stand for?
A URL starting with 'www' usually indicates a __________ URL.
A URL starting with 'www' usually indicates a __________ URL.
What does the entity '<' represent in HTML?
What does the entity '<' represent in HTML?
Flashcards
Unordered List
Unordered List
An HTML element that represents a list of items, where each item is identified with a bullet point.
Ordered List
Ordered List
An HTML element that represents a list of items, where each item is identified with a number.
<ul>
tag
<ul>
tag
The HTML tag that marks the beginning of an unordered list.
<ul>
tag
<ul>
tag
Signup and view all the flashcards
<ol>
tag
<ol>
tag
Signup and view all the flashcards
<ol>
tag
<ol>
tag
Signup and view all the flashcards
<li>
tag
<li>
tag
Signup and view all the flashcards
Flexibility of Lists
Flexibility of Lists
Signup and view all the flashcards
Enhanced Readability
Enhanced Readability
Signup and view all the flashcards
Webpage
Webpage
Signup and view all the flashcards
Source Code
Source Code
Signup and view all the flashcards
HTML (HyperText Markup Language)
HTML (HyperText Markup Language)
Signup and view all the flashcards
CSS (Cascading Style Sheets)
CSS (Cascading Style Sheets)
Signup and view all the flashcards
Web Browser Rendering
Web Browser Rendering
Signup and view all the flashcards
HTML Version
HTML Version
Signup and view all the flashcards
JavaScript
JavaScript
Signup and view all the flashcards
CSS Element Selector
CSS Element Selector
Signup and view all the flashcards
The <span>
Tag
The <span>
Tag
Signup and view all the flashcards
Embedding CSS in <head>
Embedding CSS in <head>
Signup and view all the flashcards
CSS: Controlling Webpage Appearance
CSS: Controlling Webpage Appearance
Signup and view all the flashcards
CSS Consistency Across Webpages
CSS Consistency Across Webpages
Signup and view all the flashcards
img tag
img tag
Signup and view all the flashcards
alt attribute
alt attribute
Signup and view all the flashcards
Alternate Text
Alternate Text
Signup and view all the flashcards
Empty Elements
Empty Elements
Signup and view all the flashcards
br tag
br tag
Signup and view all the flashcards
hr tag
hr tag
Signup and view all the flashcards
Image Link
Image Link
Signup and view all the flashcards
Image Hyperlink
Image Hyperlink
Signup and view all the flashcards
href attribute
href attribute
Signup and view all the flashcards
Correct Image Filename
Correct Image Filename
Signup and view all the flashcards
Absolute URL
Absolute URL
Signup and view all the flashcards
Relative URL
Relative URL
Signup and view all the flashcards
File Path
File Path
Signup and view all the flashcards
Character Entity
Character Entity
Signup and view all the flashcards
CSS Rule Applicability
CSS Rule Applicability
Signup and view all the flashcards
Why Character Entities?
Why Character Entities?
Signup and view all the flashcards
Character Entity Format
Character Entity Format
Signup and view all the flashcards
Character Entity Usage
Character Entity Usage
Signup and view all the flashcards
Why are Character Entities Important?
Why are Character Entities Important?
Signup and view all the flashcards
Study Notes
CS1102 Introduction to Computer Studies - Lecture 04
- Lecture Topic: Web Development: HTML and CSS
- Semester: A, 2024-2025
- Course Information: CS1102 Introduction to Computer Studies, City University of Hong Kong, Department of Computer Science
- Lecture materials not to be redistributed to Course Hero or other public web sites.
- Agenda (Lecture 04):
- Webpage and Source Code
- HTML
- CSS
- Construct your own webpage
- Webpage and Source Code:
- Webpages show information using text, images, audio, and video.
- HTML tags mark up webpage content.
- CSS styles webpages.
- JavaScript adds interactivity.
- Web browsers render the HTML source code.
- HTML (HyperText Markup Language):
- HTML uses tags to structure webpages.
- Tags are enclosed in angle brackets (<>).
- Most tags come in pairs (opening and closing).
- Example:
<html></html>
. - Some tags are empty elements (e.g.,
<img>
). <!DOCTYPE html>
: instructs the browser about the HTML version (e.g., HTML5).- Each HTML file contains a head section and a body section.
- The head section includes metadata like page title.
- The body section contains the webpage content.
- CSS (Cascading Style Sheets):
- CSS describes how HTML elements are displayed.
- Specifies colors, fonts, layouts, and placement of HTML elements.
- Can be embedded in the HTML file or in a separate file.
- Enables better styling and layout of webpages.
- JavaScript:
- JavaScript is a programming language that adds interactivity.
- It can dynamically generate content and improve webpage function.
- Code Editor:
- Editors like Komodo Edit or Sublime Text improve code development
- Editors offer features like syntax coloring, error checking, and code completion.
Additional Points
-
Demo Code Location: Demo code for the lecture is available on Canvas.
-
HTML Features:
- Adding a webpage title.
- Creating headings (
to
).
- Formatting paragraphs.
- Creating bullet lists.
- Creating numbered lists.
- Adding links to the webpage.
- Inserting images.
- Creating tables.
-
HTML Lists:
- Unordered lists use bullet points(
<ul>
and<li>
). - Ordered lists use automatic numbering (
<ol>
and<li>
).
- Unordered lists use bullet points(
-
HTML Links:
href
attribute contains the URL of a sitetarget="blank"
attribute opens a link in a new tab or window.
-
HTML Images:
- Images are separate files (
<img>
tag withsrc
for path) alt
attribute provides alternative text (for users with impaired vision or when the image isn't loaded).- Empty tags (e.g.
<br>
,<hr>
) take no closing tag
- Images are separate files (
-
HTML Entities:
- Entities are used to represent special characters. example:
<
=<
- Entities are used to represent special characters. example:
-
Absolute/Relative URLs:
- Absolute URLs: full web address.
- Relative URLs: path relative to current page.
-
File Paths: File paths specify locations within a website's folder structure.
-
CSS:
- Selectors: CSS styles are applied to elements by locating them using CSS selectors.
- IDs: Unique identifiers for individual elements, specified by # followed by the ID name.
- Classes: Tags that apply styles to multiple elements that can share the same class name, specified by . followed by the class name.
- Group selectors: Multiple CSS selectors separated by commas are used to apply the same styles to a group of elements.
- Color properties include RGB and hexadecimal values specifying color
- Font properties: Set using fonts.
-
CSS Display:
- Display property can change the way elements are rendered (e.g., inline or block-level elements).
-
GitHub Pages: A service to create a website using Git.
-
Templates/frameworks: pre-built websites are a practical alternative for creating a new webpage.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.