Lecture 5
Lecture 5
HTML
HTML Lists
• Unordered HTML List
• An unordered list starts with the <ul> tag. Each list item starts with the
<li> tag.
• The list items will be marked with bullets (small black circles) by
default:
HTML Lists
• The CSS list-style-type property is used to define the style of the list
item marker.
• disc
• circle
• square
• none
• The two most common display values are block and inline.
<div> as a container
• The <div> element is often used to group sections of a web page
together.
Multiple Classes
• HTML elements can belong to more than one class.
• To define multiple classes, separate the class names with a space, e.g.
<div class="city main">. The element will be styled according to all the
classes specified.
• In the following example, the first <h2> element belongs to both the
city class and also to the main class, and will get the CSS styles from
both of the classes:
Multiple Classes
HTML id Attribute
• The HTML id attribute is used to specify a unique id for an HTML element.
• You cannot have more than one element with the same id in an HTML
document.
• The id attribute specifies a unique id for an HTML element. The value of
the id attribute must be unique within the HTML document.
• The id attribute is used to point to a specific style declaration in a style
sheet. It is also used by JavaScript to access and manipulate the element
with the specific id.
• The syntax for id is: write a hash character (#), followed by an id name.
Then, define the CSS properties within curly braces {}.
Faculty Name: Arvind Panwar 21
School of Computer Science Engineering
Course Name: Web Technology Program Name: B.Tech.
HTML id Attribute
• In the following example we have an <h1> element that points to the id
name "myHeader". This <h1> element will be styled according to the
#myHeader style definition in the head section:
HTML Iframes
• An HTML iframe is used to display a web page within a web page.
• The HTML <iframe> tag specifies an inline frame.
• An inline frame is used to embed another document within the current
HTML document.
• The metadata will not be displayed on the page, but is used by browsers
(how to display content or reload page), by search engines (keywords),
and other web services.
• CSS framework
• CSS float property
• CSS flexbox
• CSS grid
HTML Entities
• HTML Character Entities
• Some characters are reserved in HTML.
• If you use the less than (<) or greater than (>) signs in your HTML text,
the browser might mix them with tags.
• Entity names or entity numbers can be used to display reserved HTML
characters.
• Entity names look like this:
HTML Entities