Podcast
Questions and Answers
What is the purpose of using CSS in web design?
What is the purpose of using CSS in web design?
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
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.
Signup and view all the answers
Match the following CSS-related terms with their descriptions:
Match the following CSS-related terms with their descriptions:
Signup and view all the answers
What is the primary function of HTML in web development?
What is the primary function of HTML in web development?
Signup and view all the answers
CSS is primarily used to add content to webpages.
CSS is primarily used to add content to webpages.
Signup and view all the answers
Name one type of media that can be displayed on a webpage.
Name one type of media that can be displayed on a webpage.
Signup and view all the answers
A webpage contains text marked up with __________ tags.
A webpage contains text marked up with __________ tags.
Signup and view all the answers
Match the following elements with their function in web development:
Match the following elements with their function in web development:
Signup and view all the answers
Which version of HTML is mentioned in the content?
Which version of HTML is mentioned in the content?
Signup and view all the answers
Web browsers can only display text and images.
Web browsers can only display text and images.
Signup and view all the answers
What is the primary function of lists in HTML?
What is the primary function of lists in HTML?
Signup and view all the answers
An unordered list in HTML displays items with automatic numbering.
An unordered list in HTML displays items with automatic numbering.
Signup and view all the answers
What are the two types of lists defined in HTML?
What are the two types of lists defined in HTML?
Signup and view all the answers
The HTML code for an unordered list begins with <> and ends with </>.
The HTML code for an unordered list begins with <> and ends with </>.
Signup and view all the answers
Match the following types of lists with their characteristics:
Match the following types of lists with their characteristics:
Signup and view all the answers
Which statement best describes the ease of using lists in HTML?
Which statement best describes the ease of using lists in HTML?
Signup and view all the answers
HTML line breaks directly correspond to how text appears in browsers.
HTML line breaks directly correspond to how text appears in browsers.
Signup and view all the answers
What does the 'li' tag represent in HTML lists?
What does the 'li' tag represent in HTML lists?
Signup and view all the answers
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.
Signup and view all the answers
What does the alt attribute in an img tag do?
What does the alt attribute in an img tag do?
Signup and view all the answers
The img tag requires a closing tag.
The img tag requires a closing tag.
Signup and view all the answers
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?
Signup and view all the answers
The img tag is used to display an image on a ______.
The img tag is used to display an image on a ______.
Signup and view all the answers
Match the following HTML tags with their functions:
Match the following HTML tags with their functions:
Signup and view all the answers
What will happen if an image cannot be displayed?
What will happen if an image cannot be displayed?
Signup and view all the answers
The img tag is an example of a block-level element.
The img tag is an example of a block-level element.
Signup and view all the answers
Name an example of an empty element in HTML.
Name an example of an empty element in HTML.
Signup and view all the answers
HTML elements that do not require an end tag are called ______ elements.
HTML elements that do not require an end tag are called ______ elements.
Signup and view all the answers
Which of the following is NOT an example of an empty element?
Which of the following is NOT an example of an empty element?
Signup and view all the answers
What type of URL contains the full path to a resource?
What type of URL contains the full path to a resource?
Signup and view all the answers
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.
Signup and view all the answers
What is the purpose of character entities in HTML?
What is the purpose of character entities in HTML?
Signup and view all the answers
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 __________.
Signup and view all the answers
Match the following URLs with their descriptions:
Match the following URLs with their descriptions:
Signup and view all the answers
Which of the following is NOT a reason to use CSS?
Which of the following is NOT a reason to use CSS?
Signup and view all the answers
HTML entities can only be used for displaying mathematical symbols.
HTML entities can only be used for displaying mathematical symbols.
Signup and view all the answers
What does CSS stand for?
What does CSS stand for?
Signup and view all the answers
A URL starting with 'www' usually indicates a __________ URL.
A URL starting with 'www' usually indicates a __________ URL.
Signup and view all the answers
What does the entity '<' represent in HTML?
What does the entity '<' represent in HTML?
Signup and view all the answers
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 site -
target="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.
Related Documents
Description
Explore the fundamentals of web development in CS1102 Lecture 04. This session covers essential topics such as HTML structure, CSS styling, and constructing your own webpage. Learn how these technologies work together to create engaging online content.