Ear edEngineering Express " HTML Comments: In HTML, comments ore used to add notes or explanations within the code that are not visible to users when the page is rendered by a browser, They are helpful for documenting the code or temporarily | disabling parts of it. HTML comments start with , Anything between these togs is treated as a comment. > Syntax: *_HTML Attributes: Used to add more information correspending to an HTML tag. Various HTML_Tags:. — " _*__shtml> Tag 2 This tag defines the topmost element, identifying-itas-an HTML document. It is a container tag that has a start and an end tag and lall the other tags and text are nested within it. Syntax: "
Tag | This tag contains information about your HTML file, it may also contain other tags that helps you to identify your HTML file to the outside world. The head tag is nested within the html tag. Syntax: =Engineering Express ed olor Teer STZ "
Paragraph Tag This tag defines a poragraph in HTML, It is used to group blocks of text into separate paragraphs, Browsers autornatically add some space before and after each_
element.
| Syntax:
«
(Line Break) Tag
This tag is used to insert a single line break in the text, without
| creating a new paragraph. Unlike the
tag, it does not add extra
|_space around the line
Syntax: eres
Line one
Line two
ele
= (Anchor) Tag
The tag is used to create hyperlinks. It allows users to navigate
to another web page or section within the same page. The most
|_important_attribute_is href, which specifies the URL
Syntax:
=
draws lines ond horizontal rules,
b) This tag draws a horizontal line wherever specified.
c) The attributes to the
tag are :
¥
ALIGN : This attribute specifies the alignment of the horizontal
rule, It can have three values as left, right and center.
SIZE ; Changes the height of the horizontal rule.
WIDTH . Sets the width of the horizontal rule,Engineering Express
SHTML Lists
A list is a collection of items. Basically there are following two types |
of lists:
1, Unordered list 2. Ordered List
|Unordered List/Bulleted List_:
Tag is used to define an unordered list.
|» Attributes of
Tag:
Attribute Description Value
. Specifies the kind of bullet to use | Dise, square, circle
‘ape in the list.
Ordered List/Numbered List:
|Tag_
is used to define an ordered list.
Tag
tag.
& Syntax:
ob
Cem erat ead
Cea gre Md
STi bg
» Attributes of
Tag:Engineering Express
Attribute Description Value
Specifies the kind of numbering to use
ae in the list, Asaf I/!
| Specifies the start value of an ordered
y Any number
list. 7
start
| | reverse | Specifies that the list order should be | reversed
descending (,8,7...)
There_is also_an additional type of list:
Dictionary List/ Description List:
Tag_
is used to define a description _list_This tag contains terms.
jand_their corresponding descriptions.
|Tag
tag.
Tag_
is used to define a table in HTM acts as a u
____|| container for all other table-related tags like
, , and .
«|| Tag is used to define row ino toble, It is placed inside ||_
___||tag and contains either header cells C
) or data cells ( ). ie
+|| Tag_sth> is used to define a table header, It represents the heading
for a column or row, and the text inside this tag is bold and
entered by default.
ag is used to define a table data cel), It represents the
content of a cell within atable row,
Attributes of ,
Specifies the wiath of
width ee Eee Pixels%
table
Specifies the space
cellpadding | between the cell wall and Pixels
the cell content
5 Specifies the space Pixels
lI.
OOPS | pet ween adjacent cells
r Merges multiple columns Any number
cop" nto a single cell, (eg, 2, 3)
/ aa Merges multiple rows into | Any number
me lg single cell. (eg, 2, 2Engineering Express
|| Syntax:
Sell
aes
eae
| Some
catae
Peres
Re reea ead
Scere Pa cog
| Sieg
cae)
Cee EP eye mad Taare es
| Sd
I a HTML images ||
isan empty tag, me
> || Attributes of Tag:
Attribute Description Value
| Syntax:
i Me ell RNR
Rd ML cel eM
eat eel Ce Mel eT ed
|| Corresponding XML Document:
SteEngineering Express Q) AD | Example: CSS_Comments: CSS comments are used to add notes or explanations ia the code, They are ignored by the browser and do not affect the styling. Why Use External CSS? Separation of Concerns: The HIML-file handles the content, while | the CSS file handles the design. This keeps the code clean and |_arganized. Reusability: You can use the same CSS_file on multiple web pages. For example, if you have a website with 10 pages, you can use one CSS. file for-all_of them. Easier to Maintain. If you want to change the look of your entire website, you can just edit the CSS file, and the changes will_be |_applied to all linked HTML pages. | Write a program in HTML to display a heading and a paragraph. | Then use CSS to display heading in_red colour and text of the paragraph in blue colour. Try it yourself.Engineering Express t CSS Selectors: CSS selectors are used to target HTML elements so that you can apply styles to them. Here are the most common types of selectors: | Universal Selector C*): Selects all elements onthe page. Example: TCL Poel Element Selector Cag Selector): Targets_all elements. of a specific type. Example: Ae Group Selector (Grouping): Allows you to apply the same styles to multiple elements by separating them with commas without repeating the CSS rule for | each element. This is efficient for maintaining clean code, Exarnple: aE eCEngineering Express & CSS id and Class Class Selector C.classname): Targets elements with a specific class attribute. The class can be applied to multiple elements. Exarnple, ae Po ID Selector (#idname): = Targets a specific element with-an id-attribute. Unlike a class, the id must be uniqueto one_element. Exarnple: cer ae eee ACSS Properties and Styling [css properties are the rules you can apply to elements to control how | they look, Each property is followed by a value that defines how that | specific aspect af the element should be styled. Here are some common CSS properties: Background Properties; background-color: Sets the background color of an element. background-image: Adds an image as the background, | background-repeat: Defines if the background image repeats (e.g, repeat-x, repeat-y, no-repeat and the default is repeat).the size of the backgr (katt attachment: iB Cong: ee ee oem background-image: urlCbackground jj De ee Sc Le background- ee ee aaa ae en Rea || Text Properties:Engineering Express © word-spacing: Controls the space between words. Common values include: positive or negative values. Example: Cn bee ect eee ima ae Taig a ae word-spacing: Spx; Font. Properties: font-family: It lets you choose which font to use on your webpage. You_can_list_several fonts, so if one isn't available, the browser tries the next one. Fonts can be specific ones like Arial or lmpact and you can also use generic names, ¥___ Sans-serif — Arial, Futura ¥__Serif- Time New Roman, Garaynond y¥___Fantasy- Impact, Comic Sans | ¥ Monospace - Courier, Consolas font-size: The font-size property in CSS specifies the size of the text You can use predefined size names like large, small, medium, or specify a custom size using units like pt, px, %, em, or rem font-variant; The font-variant property in CSS is used to change the appearance of text, specifically how the text is displayed. It_is | commonly used to create small-caps text, where lowercase letters are ltransformed into smaller uppercase letters.Engineering Express « || Example: font-style: It is used to define various types of font styles like italics, oblique, normal (default text style), etc. Example: ACSS Color | Color in CSS is used to define the color of text, backgrounds, borders, land other elements.it can be specified in several different ways, allowing for flexibility and_customization_in_web design. Types_of color values: Named Colors: CSS supports a list of predefined color names like red, blue, green, etc. Example. fae Coen Hexadecimal (Hex) Colors: A _6-digit code where the first two characters represent _red, the next two green, and last two blue, Values range from 00 to FF,Engineering Express - || Example: RGB (Red, Green, Blue): Specifies the intensity of red, green, and blue using numbers between 0 and 25S. aaa LRGBA (Red, Green, Blue, Alpha). Similar to RGB, but with an extra value called alpha for transparency. The alpha value ranges from_0 (completely transparent) to | | Ccompletely opaque) | Example, |HSL CHue, Saturation, Lightness): | Uses hue (color), saturation Gutensity), and_lightness Chrightness) Hue is a degree from 0 to 360, saturation isa percentage from 0% \to 100%, ond _lightness_is alsa_a_percentage. Example: Working with Block Elements and Objects | Block Elements: Block elements are HTML elements thet occupy the full width available, creating a new line before and after themselves, They are primarily used for structural purposes in a webpage. Common block elements include
,