DIT Notes
DIT Notes
Introduction of Computer
COMPUTER (Common Operating Machine Particularly Used for Technical Education & Research)
Charles Babbage (1791 – 1871): - Charles Babbage is the father of computer. He was the mathematics
professor in Cambridge University.
The world first computer invented by Charles Babbage in (1833)
Ada Lovelace: (1815-1852):- Ada was the students of Charles Babbage. She was the world first computer
programmer.
Analytical Engine: -Analytical Engine was programmable mechanical digital machine that access the power
through Crank-Driven.
Q: What is Computer?
Ans: Computer is an electronic machine that is used for process any data or information.
Q: What is data?
Ans: Which matter we can write with the help of keyboard is called data.
OR
Raw facts and figures are called data.
1 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Elements of Computer
There are five main elements of computer.
1. Hardware
2. Software
1. Data/ Information
2. User
3. Procedure
1. Hardware: -All the touchable parts of computer which we can touch is called hardware.
For Example: Keyboard, CPU, LCD etc.
2. Software: - All the programs of computer which we can follow the instructions that is called software.
For Example: MS Paint, MS Office, Notepad etc.
3. Data: -Raw facts and figures are called data.
4. User: -Which operate the computer is called user.
For Example: Ali, Asad, Umair etc.
5. Procedure: - The way to operate the computer is called procedure.
Q: How many types of Software?
Ans: There are two main types of software.
1. Application Software.
2. System Software.
1. Application Software:-These types of software which is used for only user purpose that is called
application software.
For Example: Ms Paint, WordPad, Ms Office etc
2. System Software:-These types of software which is used for only system purpose that which control and
manage the other application softwares that is called system software.
For Example: Ms Windows, DOS etc.
2 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Input Devices = CPU (Processing) = Output Devices
Mouse = Motherboard = Monitor/ LCD
Keyboard = Hard Drive = Printer
Scanner = Floppy Disk = Speaker
Digital Camera = (SSD) = Modem
Joy Stick = RAM = Projector
Microphone = ROM = Etc
Etc = Power supply
= VGA Card
= DVD Rom
= CD Rom
= LAN Card
= Etc
Abbreviations
RAM (Random Access Memory) ROM (Read Only Memory)
SSD (Solid State Drive) VGA (Video Graphic Array)
DVD (Digital Versatile Disc) CD (Compact Disc)
LAN (Local Area Network) WAN (Wide Area Network)
LCD (Liquid Crystal Display)
Generations of Computer
First Generation (1940s–1950s)
Technology Used:
• Vacuum Tubes: Used as the primary electronic component for circuitry.
• Magnetic Drums: Used for memory storage.
Key Features:
• Large, heavy, and required significant amounts of power.
• High heat production and frequent failures due to vacuum tube limitations.
• Programming was done using machine language (binary code).
• Input and output were handled via punch cards and paper tape.
Examples:
• ENIAC (1945): First general-purpose electronic computer.
• UNIVAC (1951): First commercially available computer.
Applications:
• Military purposes (e.g., ballistic calculations).
• Scientific computations and data processing.
3 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Second Generation (1950s–1960s)
Technology Used:
• Transistors: Replaced vacuum tubes, making computers smaller, faster, and more reliable.
• Magnetic Core Memory: Used for storage.
Key Features:
• Faster processing speeds compared to the first generation.
• Reduced size and power consumption.
• Introduction of high-level programming languages like COBOL and FORTRAN.
• Input and output devices improved (e.g., printers and magnetic tape storage).
Examples:
• IBM 1401
• UNIVAC II
Applications:
• Business applications (e.g., payroll and inventory management).
• Scientific research and engineering calculations.
Examples:
• Apple II (1977)
• IBM PC (1981)
4 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Applications:
• Office work, gaming, and personal use.
• Widespread in industries, education, and communication.
Comparison of Generations
Feature 1st Gen 2nd Gen 3rd Gen 4th Gen 5th Gen
AI, Quantum
Technology Vacuum Tubes Transistors ICs Microprocessors
Computing
5 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Classification of Computers
Computers are classified into different types based on their size, functionality, purposes and processing
power. Below are the main types of computers:
Based on Size and Processing Power
1. Supercomputers: The most powerful computers designed for extremely complex computations
and data-intensive tasks.
Uses: Weather forecasting, scientific research, space exploration, and nuclear simulations.
Example: IBM Summit, Fugaku.
2. Mainframe Computers: Large, high-capacity machines used by organizations for critical
applications requiring vast data processing and storage.
Uses: Banking, government operations, and airline reservations.
Example: IBM zSeries, Unisys ClearPath.
3. Minicomputers (Mid-Range Computers): Medium-sized computers used by small and medium
Enterprises for specific tasks.
Uses: Manufacturing control, data processing, and scientific analysis.
Example: PDP-11, VAX systems.
4. Microcomputers (Personal Computers or PCs): Compact, affordable computers designed for
Individual use.
Uses: Office work, gaming, browsing, and education.
Example: Desktops, laptops, and tablets.
Based on Functionality
1. Analog Computers: Computers that process continuous data (e.g., temperature, pressure).
Uses: Scientific simulations and control systems.
Example: Analog flight computers.
2. Digital Computers: Computers that process discrete data in binary format (0s and 1s).
Uses: Everyday computing tasks.
Example: Desktops, laptops.
3. Hybrid Computers: Combine features of both analog and digital computers.
Uses: Medical applications like ECG machines, and industrial applications.
Example: Hybrid diagnostic machines.
Based on Purpose
1. General-Purpose Computers: Designed to perform a wide range of tasks based on the user's
needs.
Uses: Word processing, browsing, gaming, and software development.
Example: Personal computers, laptops.
2. Special-Purpose Computers: Built for specific tasks or applications.
Uses: Traffic control systems, washing machines, medical devices.
Example: Embedded systems in devices.
6 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Units of Computer Memory Measurements
➢ 0,1 = 1 Bit (Binary Digit
➢ 8 Bits = 1 Byte
➢ 1024 Bytes = 1 KB (Kilo Byte)
➢ 1024 KB = 1 MB ( Mega Byte)
➢ 1024 MB = 1 GB (Gega Byte)
➢ 1024 GB = 1 TB (Tera Byte)
➢ 1024 TB = 1 PB (Peta Byte)
➢ 1024 PB = 1 EB (Exa Byte)
➢ 1024 EB = 1 ZB (Zetta Byte)
➢ 1024 ZB = 1 YB (Yotta Byte)
➢ 1024 YB = 1 BB (Bronto Byte)
➢ 1024 BB = 1 Geop Byte
Geop Byte is the highest Memory
What is an Operating System?
An operating system (OS) is software that manages computer hardware and software resources, and provides
services for running applications.
Examples of Operating Systems:
For PCs:
1. Microsoft Windows
• Examples: Windows 10, Windows 11
2. macOS
• Examples: macOS Monterey, macOS Ventura
3. Linux Distributions
• Examples: Ubuntu, Fedora, Debian, Linux Mint
4. UNIX
• Examples: Solaris, AIX, HP-UX
5. FreeBSD
For Mobile Devices (Bonus):
• Android, iOS
What is MS Windows?
MS Windows is a popular operating system developed by Microsoft, providing a graphical user interface
(GUI) for personal computers and devices.
Versions of MS Windows
➢ Windows 1.0 (1985) ➢ Windows XP (2001)
➢ Windows 2.0 (1987) ➢ Windows Vista (2007)
➢ Windows 3.0 (1990) ➢ Windows 7 (2009)
➢ Windows 95 (1995) ➢ Windows 8 (2012)
➢ Windows 98 (1998) ➢ Windows 8.1 (2013)
➢ Windows ME (2000) ➢ Windows 10 (2015)
➢ Windows 2000 ➢ Windows 11 (2021)
7 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Explanation of 0 and 1 in Computing
In computing, 0 and 1 are the fundamental building blocks of digital systems. They are part of the binary
number system, which computers use to process and store data. Here's a breakdown:
Binary System
• The binary system uses only two digits: 0 and 1.
• Each digit in the binary system is called a bit (binary digit).
Representation of 0 and 1
• 0: Represents the "off" state (low voltage or absence of current).
• 1: Represents the "on" state (high voltage or presence of current).
This on/off representation matches the behavior of electronic circuits, where switches (transistors) can either
be open (off) or closed (on).
Control Panel
Control panel option is used to customize the setting of [Link] as: Set the date and
time, Set the display setting, Change the mouse setting, Check the system information, add / remove
any program, manage user accounts, and set the network setting etc.
8 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
INTRODUCTION TO MICROSOFT OFFICE
MS Office (Microsoft Office) is a comprehensive suite of productivity software developed by Microsoft. It is
designed to assist users in performing a wide range of office-related tasks such as document creation, data
analysis, presentations, and communication. MS Office is widely used in personal, educational, and
professional settings due to its versatility and user-friendly interface. MS Office is label following main four
components.
Component Name = Purpose = Open in Search option
MS Word = Documentation = winword
MS Excel = Accounting = excel
MS PowerPoint = Presentation = powerpnt
MS Access = Database = msaccess
MS Office Versions Description
Microsoft Office 95
Released in 1995, this version was designed for Windows 95
(Version 7.0)
Introduced in 1996, Office 97 brought the Office Assistant (Clippy) and
Microsoft Office 97
enhanced user interfaces, along with improved integration between
(Version 8.0)
applications.
Microsoft Office 2000 Launched in 1999, this version introduced personalized menus and toolbars
(Version 9.0)
Microsoft Office XP Released in 2001, Office XP focused on improved security and stability,
(Version 10.0) introducing features like Smart Tags and Task Panes.
Debuted in 2003, this version featured a new branding with colored title bars
Microsoft Office 2003
for each application and introduced the Reading Layout and Research Task
(Version 11.0)
Pane.
Microsoft Office 2007 Released in 2007, Office 2007 introduced the Ribbon interface and new file
(Version 12.0) formats (.docx, .xlsx, .pptx) based on Office Open XML.
Microsoft Office 2010 Launched in 2010, this version improved the Ribbon interface, introduced
(Version 14.0) Backstage view, and offered Office Web Apps for online editing.
Microsoft Office 2013 Introduced in 2013, Office 2013 was designed for touch and mobile use, with
(Version 15.0) enhanced cloud integration through OneDrive.
Microsoft Office 2016 Released in 2015, this version offered real-time co-authoring, improved data
(Version 16.0) analysis tools in Excel, and better collaboration features.
Launched in 2018, Office 2019 provided a one-time purchase option with
Microsoft Office 2019
features like learning tools, text-to-speech, and enhanced inking functionality.
Released in 2021, this version continued the one-time purchase model,
Microsoft Office 2021
offering performance improvements and additional tools.
Introduced in October 2024, Office 2024 is available as a perpetual license,
allowing users to utilize the software without subscription fees. It includes
Microsoft Office 2024
updated applications like Word, Excel, PowerPoint, OneNote, and Outlook,
featuring numerous improvements and accessibility enhancements.
9 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Microsoft Word
MS Word (Microsoft Word) is a word processing application developed by Microsoft. It is the family
member of Microsoft Office. It is used for documentation purpose. In which we can create Notes,
Applications, Letters, Paragraphs, [Link] and Certificates etc. It is default extension is (docx).
10 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
11 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
File Tab (Backstage View)
Save & Save As→ Saves documents in different formats (.docx, .pdf, .rtf, .txt, etc.).
Open→ Opens existing documents.
New→ Provides templates for document creation.
Print→ Allows print preview and printing settings.
Save & Send→ Options to send documents via email, fax, or publish online.
Options→ Customization settings for Word.
12 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Numbering: The Numbering command creates an ordered list using numbers or letters.
Borders and Shading: The Borders and Shading command applies borders around text and fills the
background with color.
Sort: The Sort command arranges text or numbers in ascending (A-Z) or descending (Z-A) order.
Paragraph: The Paragraph command controls text alignment, indentation, and spacing.
Find (Ctrl + F): The Find command searches for specific words or phrases in the document.
Replace (Ctrl + H): The Replace command finds and replaces words or phrases with another text.
Go To (Ctrl + G): The Go To command navigates directly to a specific page, line, section, or bookmark.
Insert Tab Commands
Page Break (Ctrl + Enter): The Page Break command moves content after the cursor to a new page.
Table → Insert Table: This command inserts a table into the document.
Table → Draw Table: This command allows you to manually draw a table with custom row and column
sizes.
Table → Convert Text to Table: This command converts selected text into a table based on delimiters (such
as commas or tabs).
Delete→ Delete Cell/ Delete Column/Delete Row/ Delete Table: These commands are used to removes
selected table elements like (Cell/Column/Row/Table)
Insert Above/Insert Below/Insert Left/Insert Right: These commands are used to inserts new rows or
columns in an existing table.
Merge Cells: This command is used to combines multiple selected cells into one cell.
Split Cells: This command divides a selected cell into multiple cells.
Split Table: This command is used to separates a table into two tables.
Autofit: This command automatically adjusts column width based on content or window size.
Distribute Rows/Distribute Columns: These commands evenly adjusts row height or column width.
Table Alignment: This command aligns the table within the document.
Text Direction: This command changes the orientation of text inside a table cell.
Cell Margins: This command adjusts the spacing between text and cell borders.
Repeat Heading Row: This command repeats the first row of a table on every new page.
Convert Table to Text: This command converts a table data back into plain text.
Formula: This command allows you to perform calculations inside a table.
Picture: This command inserts an image from your computer.
13 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Clip Art: This command inserts pre-designed graphics from Microsoft’s collection.
Shapes: This command adds different geometric shapes to the document.
SmartArt: This command inserts visual diagrams for organizing information.
Chart: This command inserts different types of charts (bar, pie, line, etc.).
Hyperlink (Ctrl + K): This command adds a clickable link to a webpage, file, or email.
Bookmark: This command marks a specific location in the document for quick navigation.
Header and Footer: This command inserts headers on the top side of page and footers at the bottom side of
page that will repeat on every page in the document.
Page Number: This command inserts automatic page numbers.
Text Box: This command inserts a movable text box.
WordArt: This command adds stylized decorative text.
Drop Cap: This command enlarges the first letter of a paragraph.
Date and Time: This command inserts the current date and time in various formats.
Object → Object: This command inserts an external object (e.g., Excel spreadsheet, PDF, PowerPoint slide,
etc.) into the document.
Object → Text from File: This command inserts the content of an external text file into the document.
Equations: This command allows you to insert mathematical equations using built-in templates or custom
formulas.
Symbol: This command inserts special characters or symbols that are not available on the keyboard.
Page Layout Tab
Page Setup → Margins: The Margins command adjusts the space between the text and the edges of the page.
Page Setup → Orientation: The Orientation command changes the page layout between portrait (vertical)
and landscape (horizontal).
Page Setup → Size: The Size command changes the dimensions of the page like (A4, Legal)
Page Setup → Columns: The Columns command divides text into multiple columns (like in newspapers).
Breaks: The Breaks command is used to separate text by inserting different types of breaks (Page Break,
Section Break, Column Break).
Watermark: The Watermark command inserts a faint image or text in the background (e.g., "Confidential,"
"Draft").
Page Color: The Page Color command changes the background color of the document.
Page Borders: The Page Borders command adds decorative borders around the entire page.
14 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
References Tab Commands
Table of Contents: The Table of Contents command automatically generates a structured list of headings in
the document.
Add Text (For Table of Contents): This command adds selected text to the Table of Contents.
Update Table: This command updates the Table of Contents when changes are made in the document.
Insert Footnote (Ctrl + Alt + F): A Footnote provides additional information at the bottom of the page.
Insert Endnote (Ctrl + Alt + D): An Endnote provides references or explanations at the end of the
document.
Next Footnote: This command quickly navigates to the next footnote or endnote.
Show Notes: This command displays all footnotes or endnotes in the document.
Insert Citation: The Insert Citation command adds references from different sources (books, articles, etc.).
Manage Sources: This command manages and edits all citations used in the document.
Insert Caption: This command adds a label to images, tables, or charts.
Cross-Reference: The Cross-Reference command links to other parts of the document.
Mark Entry (For Index): The Mark Entry command selects text to be included in the index.
Insert Index: An Index lists important terms and their page numbers.
Update Index: This command refreshes the index after making changes.
Table of Authorities: This command inserts a list of legal references (cases, laws, books).
Mailing Tab Commands
Start Mail Merge: The Start Mail Merge command allows you to create a batch of personalized documents
(letters, emails, labels, envelopes).
Select Recipients: The Select Recipients command lets you choose the data source for the mail merge.
Edit Recipient List: This command allows you to modify the selected recipient list.
Write & Insert Fields → Insert Merge Field: The Insert Merge Field command adds personalized data
fields (e.g., Name, Address).
Write & Insert Fields → Address Block: The Address Block command inserts a complete address format.
Write & Insert Fields → Greeting Line: The Greeting Line command adds a personalized salutation (e.g.,
"Dear Mr. Smith").
Write & Insert Fields → Insert Merge Field: The Insert Merge Field command inserts custom fields from
the recipient list.
15 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Write & Insert Fields → Rules: The Rules command allows conditional formatting (e.g., "If-Then-Else"
logic for personalization).
Write & Insert Fields → Match Fields: The Match Fields command aligns fields in the recipient list with
Word’s default merge fields.
Write & Insert Fields → Update Labels: This command updates labels with the latest recipient data.
Preview Results: The Preview Results command shows how the merged document will look.
Finish & Merge: The Finish & Merge command finalizes the mail merge process.
View Tab Commands
Document Views → Print Layout: The Print Layout view displays the document as it will appear when
printed, including margins, headers, footers, and images.
Document Views → Full Screen Reading: The Full Screen Reading view optimizes the document for
reading by displaying it in a large, distraction-free format.
Document Views → Web Layout: The Web Layout view displays the document as it would appear in a web
browser.
Document Views → Outline: The Outline view allows users to see the document structure and move
sections easily.
Document Views → Draft: The Draft view focuses on text content without displaying headers, footers, or
images.
Show → Ruler: The Ruler command displays or hides the horizontal and vertical rulers for precise
formatting.
Show → Gridlines: The Gridlines command displays a set of gridlines that help align text and objects.
Show → Navigation Pane: The Navigation Pane helps users find text, headings, and pages within the
document.
Zoom → Zoom: The Zoom command allows users to magnify or shrink the document for better readability.
Window → New Window: The New Window command opens the same document in a new window.
Window → Split: The Split command divides the document window into two panes for easier editing.
Window → Remove Split: The Remove Split command removes the split-screen view.
Window → Synchronous Scrolling: The Synchronous Scrolling command allows scrolling in two
documents at the same time when using "View Side by Side."
Macros → Macros: The Macros command allows users to create, run, and manage recorded macros.
16 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Introduction of MS Excel
Microsoft Excel 2010 is a spreadsheet application developed by Microsoft, used for
organizing, analyzing, and visualizing data. It allows users to perform calculations, create charts, manage
databases, and automate tasks using formulas and functions. Actually, MS Excel is the grid of row and
columns. There are 16384 columns, 1048576 rows and cells quantity 17179869184 in a work sheet. There are
three default work sheets in a work book. MS excel file default extension is (xlsx)
Common Uses of MS Excel
Financial Accounting & Budgeting
Data Analysis & Reporting
Project Management
Mathematical Calculations
Inventory & Sales Tracking
Opening Steps of MS Excel
1. Click on start button.
2. Type program name “excel” in search box.
3. Then press enter button.
17 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Ctrl + Spacebar Select entire column
Shift + Spacebar Select entire row
Ctrl + A Select all cells in the worksheet
Ctrl + C Copy
Ctrl + X Cut
Ctrl + V Paste
Ctrl + D Fill down (copy the content from the cell above)
Ctrl + R Fill right (copy the content from the cell on the left)
Alt + H + H Open Fill Color menu
Alt + H + F + C Open Font Color menu
Ctrl + 1 Open Format Cells dialog box
Ctrl + 9 Hide the selected row
Ctrl + Shift + 9 Unhide the selected row
Ctrl + 0 Hide the selected column
Ctrl + Shift + 0 Unhide the selected column
= (Equal Sign) Start writing a formula
Alt + = AutoSum (Quickly sum up selected numbers)
F2 Edit the selected cell
Ctrl + Shift + L Apply or remove filters
Ctrl + T Convert range into a table
Alt + D + F + F Apply filter on selected data
Ctrl + Shift + "+" Insert a new row or column
Ctrl + "-" Delete the selected row or column
Ctrl + Page Up Move to the previous sheet
Ctrl + Page Down Move to the next sheet
Shift + F11 Insert a new worksheet
Ctrl + Shift + "~" Apply General Number format
Ctrl + Shift + "$" Apply Currency format
Ctrl + Shift + "%" Apply Percentage format
Ctrl + Shift + "#" Apply Date format
Ctrl + Shift + "@" Apply Time format
18 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Home Tab Commands
Borders: The Borders option adds borders around selected cells.
Left, Center, Right Alignment: These options align text inside a cell.
Merge & Center: The Merge & Center option merges multiple cells into one and centers the text.
Wrap Text: The Wrap Text option makes text fit inside a cell by wrapping it onto multiple lines.
Number Format: The Number Format command formats numbers as currency, percentage, or date.
Conditional Formatting: The Conditional Formatting command changes cell appearance based on
conditions.
Format as Table: The Format as Table option converts a range of data into a formatted table.
Insert→ Insert Cell/ Insert Sheet Row/ Insert Sheet Column/Insert Sheet: These options inserts new cells
/rows/columns/sheet in the workbook, shifting the existing content downward or to the right.
Delete→ Delete Cells/Delete Sheet Rows/ Delete Sheet Column/Delete Sheet: These options are used to
delete any selected cells/rows/column/sheet.
Format→ Row Height: This option adjusts the height of the selected row(s).
Format→ Column Width: This option adjusts the width of the selected column(s).
Format→ Autofit Row Height: This option automatically adjusts the row height to fit the content inside the
row.
Format→ Autofit Column Width: This option automatically adjusts the column width to fit the content
inside the column.
Format→ Hide/Unhide: This option hides or unhides selected rows, columns, or sheets.
Format→ Rename Sheet: This option changes the name of the worksheet.
Format→ Move or Copy Sheet: This option moves or duplicates a worksheet within the workbook.
Format→ Tab Color: This option changes the color of the sheet tab.
Format→ Protect Sheet: This option prevents unauthorized changes to the worksheet.
AutoSum (Σ): The AutoSum command automatically adds a range of numbers.
Fill Group: This option fills cells with a pattern, color, or sequence of values.
Clear Group: This option removes content, formatting, or hyperlinks from selected cells.
Sort & Filter: The Sort & Filter option organizes data in ascending/descending order or filters specific
values.
19 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Insert Tab Commands
PivotTable: A PivotTable is a powerful tool that helps summarize, analyze, and present large datasets in a
structured format. It allows users to reorganize and group data without changing the original dataset.
Table: A Table helps organize data into a structured format with sorting and filtering capabilities. It applies
formatting automatically and makes data analysis easier.
Picture: The Picture option allows users to insert an image from a local computer into an Excel sheet.
Clip Art: Clip Art provides a collection of pre-made images and illustrations that users can insert into their
spreadsheets.
Chart: The Chart tool is used to represent numerical data visually using various chart types like bar charts,
pie charts, and line graphs.
Page Layout Tab
Margins: The Margins command is used to set the amount of blank space between the content of the
worksheet and the edges of the printed page.
Orientation: The Orientation option allows users to switch between Portrait (vertical) and Landscape
(horizontal) page layouts to adjust the printout format.
Size: The Size command allows users to adjust the paper size for printing (A4, Letter, Legal, etc.).
Print Area: The Print Area command is used to specify a portion of the worksheet that should be printed,
excluding unwanted data.
Breaks: The Breaks option allows users to manually insert page breaks to control where a new page begins
during printing.
Background: The Background command allows users to insert an image as a worksheet background. (Note:
This background is only for display and will not print.)
Print Titles: The Print Titles option ensures that row and column headers (titles) are repeated on each
printed page, making it easier to read long spreadsheets.
Width & Height: These options allow users to fit the worksheet to a specific number of pages while printing,
preventing extra blank pages.
Scale: The Scale option lets users increase or decrease the printed content size without affecting the actual
worksheet.
Gridlines: The Gridlines option allows users to show or hide the gridlines on the worksheet for easier data
viewing. (Note: Gridlines do not print unless enabled.)
20 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Headings: The Headings option allows users to display or hide row and column labels (A, B, C, 1, 2, 3) in
the worksheet.
Bring to Front & Send to Back: These commands allow users to arrange overlapping objects (shapes,
pictures) by bringing them forward or sending them behind other objects.
Selection Pane: The Selection Pane displays a list of all objects in the worksheet, allowing users to easily
manage and reorder them.
Align: The Align option allows users to align multiple objects (shapes, images) along the top, bottom, left,
right, or center.
Group & Ungroup: The Group option lets users combine multiple objects (shapes, images) so they move
and resize together. The Ungroup option separates them.
Rotate: The Rotate option allows users to rotate or flip objects within the worksheet.
Data Tab Commands
From Access: The From Access imports data from a Microsoft Access database (.mdb or .accdb) into an
Excel worksheet.
From Web: The From Web imports data from a webpage into Excel.
From Text: The From Text imports data from a .txt or .csv file and allows formatting options like delimiters
(comma, tab, space).
From Other Sources: The From Other Sources allows importing data from SQL Server, XML files, and
other databases.
Existing Connections: The Existing Connections displays a list of saved external data connections and lets
users reconnect to them.
Refresh All: The Refresh All updates all external data connections to display the latest data.
Connections: The Connections manages all linked external data sources in the workbook.
Properties: The Properties defines settings for external data sources, including refresh intervals and data
formatting options.
Edit Links: The Edit Links allows users to manage and update links to external workbooks.
Advanced Filter: The Advanced Filter provides more complex filtering options, such as filtering data to
another location.
Text to Columns: The Text to Columns splits the contents of a single column into multiple columns based
on delimiters like commas or spaces.
21 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Remove Duplicates: The Remove Duplicates deletes duplicate values from a dataset, keeping only unique
records.
Data Validation: The Data Validation controls what type of data can be entered into a cell (e.g., numbers
only, date range).
Group: This options groups multiple rows or columns together so they can be collapsed or expanded.
Ungroup: This option removes a grouping from selected rows or columns.
Subtotal: This option inserts subtotal calculations into a dataset based on grouped values.
Show Detail / Hide Detail: These options expands or collapses grouped rows or columns.
Review Tab Commands
Spelling (F7) The Spelling option checks for spelling errors in the worksheet and provides suggestions for
correction.
Research: The Research option opens a research pane that provides access to dictionaries, thesauruses, and
translation services.
Thesaurus: The Thesaurus option suggests synonyms for the selected word.
Translate: The Translate option translates words or phrases into another language using Microsoft
Translator.
New Comment: The New Comment option inserts a comment in a cell to provide additional information.
Edit Comment: The Edit Comment option modifies an existing comment.
Delete Comment: The Delete Comment removes a comment from a cell.
Previous and Next Comment: This option moves to the previous or next comment in the worksheet.
Show/Hide Comment: This option toggles the visibility of a comment in the selected cell.
Show All Comments: This option displays all comments in the worksheet at once.
Protect Sheet: This option prevents unauthorized editing of the worksheet by setting a password.
Protect Workbook: This option restricts changes to the workbook structure, such as adding, deleting, or
moving sheets.
Allow Users to Edit Ranges: This option specifies which cells can be edited even when the sheet is
protected.
Track Changes: This option records all changes made in the workbook for review and approval.
Accept/Reject Changes: This option approves or discards tracked changes in the workbook.
Share Workbook: This option allows multiple users to work on the same workbook simultaneously.
22 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Protect and Share Workbook: This option protects the workbook while allowing multiple users to
collaborate.
Compare and Merge Workbooks: This option merges multiple copies of a workbook with different changes
into a single file.
View Tab Commands
Normal View: This option displays the default worksheet layout without any page breaks or print layout
adjustments.
Page Layout View: This option shows the worksheet as it would appear when printed, including headers,
footers, and margins.
Page Break Preview: This option displays where page breaks will occur when printing the worksheet.
Custom Views: This option saves and applies different display settings for a worksheet.
Full Screen: This option hides all toolbars and menus, displaying only the worksheet for maximum
workspace.
Show Group: This group controls the visibility of gridlines, row/column headers, formula bars, and rulers.
Ruler: This option displays a ruler to adjust margins and align objects when using Page Layout View.
Gridlines: This option shows or hides the cell gridlines in the worksheet.
Headings: This option toggles the visibility of row numbers and column letters.
Formula Bar: This option displays or hides the Formula Bar, which shows the contents of the selected cell.
Zoom Group: This group controls the zoom level of the worksheet for better visibility.
Freeze Panes: This option locks specific rows or columns to keep them visible while scrolling.
Split: This option divides the worksheet into separate scrollable sections.
23 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Start the formula’s of Ms Excel
Addition +
Subtraction -
Row
Assignment Operator
= sum (A2 + B2 )
24 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Most Commonly Used Excel Formulas with Definitions & Examples
Formula Definition & Example
Definition: Adds or calculate a range of numbers
SUM Example: =SUM (A1:A5)
Output: Adds values from A1 to A5.
Definition: Adds numbers that meet a specific condition.
SUMIF Example: =SUMIF (A1:A5, ">50")
Output: Sums values greater than 50 in A1:A5.
Definition: Counts the number of numeric values in a range.
COUNT Example: =COUNT (A1:A10)
Output: Counts numbers in A1 to A10.
Definition: Counts the number of non-empty (text or numbers) cells.
COUNTA Example: =COUNTA (A1:A10)
Output: Counts all non-empty cells in A1 to A10.
Definition: Counts empty cells in a range.
COUNTBLANK Example: =COUNTBLANK (A1:A10)
Output: Counts blank cells in A1 to A10.
Definition: Counts values that meet a specific condition.
COUNTIF Example: =COUNTIF (A1:A10, ">100")
Output: Counts numbers greater than 100.
Definition: Multiplies all numbers in a range.
PRODUCT Example: =PRODUCT (A1:A3)
Output: Multiplies A1 × A2 × A3.
Definition: Returns a number raised to a power.
POWER Example: =POWER (5,2)
Output: Calculates 5² (result: 25).
Definition: Returns the average (arithmetic mean) of a range.
AVERAGE Example: =AVERAGE (A1:A5)
Output: Calculates the average of values in A1 to A5.
Definition: Returns the smallest number in a range.
MIN Example: =MIN (A1:A5)
Output: Finds the lowest value in A1 to A5.
Definition: Returns the largest number in a range.
MAX Example: =MAX (A1:A5)
Output: Finds the highest value in A1 to A5.
Definition: Counts the number of characters in a text string.
LEN Example: =LEN("Excel")
Output: Returns 5.
25 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Definition: Replaces a specific part of a text string with another text.
SUBSTITUTE Example: =SUBSTITUTE ("Excel 2007", "2007", "2010")
Output: Returns "Excel 2010".
Definition: Finds the position of a character or substring in a text string (case-
FIND sensitive).
Example: =FIND("c","Excel")
Output: Returns 3.
Definition: Capitalizes the first letter of each word in a text string.
PROPER Example: =PROPER ("excel formulas")
Output: Returns "Excel Formulas".
Definition: Converts text to uppercase.
UPPER Example: =UPPER("excel")
Output: Returns "EXCEL".
Definition: Converts text to lowercase.
LOWER Example: =LOWER("EXCEL")
Output: Returns "excel".
Definition: Returns the current date.
TODAY Example: =TODAY ()
Output: Returns today's date.
Definition: Returns the current date and time.
NOW Example: =NOW ()
Output: Returns current date & time.
Definition: Joins two or more text values.
CONCATENATE Example: =CONCATENATE (A1, " ", B1)
Output: Combines A1 and B1 with a space.
Definition: This formula calculates the total number of complete years between
the date of birth (in cell A1) and today's date.
Example: =DATEDIF(A1, TODAY(), "Y") & " Years, " & DATEDIF(A1,
TODAY(), "YM") & " Months, " & DATEDIF(A1, TODAY(), "MD") & " Days"
DATEDIF • "Y" → Counts the number of complete years.
• "YM" → Counts the number of remaining months after full years.
• "MD" → Counts the number of remaining days after full months.
Output: If A1 = 15/08/1995 and today is 25/01/2025, the result will be:
29 Years, 5 Months, 10 Days
Definition: Returns a value based on a condition.
IF Example: =IF(A1>50, "Pass", "Fail")
Output: Returns "Pass" if A1 > 50, otherwise "Fail".
Definition: Searches for a value in a range and returns a corresponding value.
LOOKUP Example: =LOOKUP (40, A1:A5, B1:B5)
Output: Output: Looks for 40 in A1:A5 and returns the corresponding B value.
26 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Definition: Searches for a value in the first column of a range and returns a value
from another column.
VLOOKUP Example: =VLOOKUP (101, A2:C10, 2, FALSE)
Output: Finds 101 in column A and returns the corresponding value from column
2.
Definition: Searches for a value in the first row and returns a corresponding value
from another row.
HLOOKUP
Example: =HLOOKUP(101, A1:D3, 2, FALSE)
Output: Finds 101 in row 1 and returns the corresponding value from row 2.
27 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Introduction of MS PowerPoint
Microsoft PowerPoint is a presentation software developed by Microsoft that allows users to create, design,
and present slide-based visual presentations. It is part of the Microsoft Office and is widely used in business,
education, and personal projects to display information effectively through slides containing text, images,
charts, animations, and multimedia. MS PowerPoint files default extension is (pptx)
Opening Steps of MS PowerPoint
1. Click on start button.
2. Click on search bar.
3. Type program name (powerpnt)
4. Then press enter button.
28 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Home Tab Commands
New Slide (Ctrl + M): This option inserts a new slide into the presentation.
Layout: This option changes the layout of an existing slide by selecting a predefined design.
Reset: This option resets the slide layout to its original formatting.
Section: This option allows users to organize slides into different sections for better management.
Drawing Tools (Shapes, Arrange, Quick Styles, etc.): This option allows users to insert and format shapes,
arrange objects, and apply visual styles.
Insert Tab Commands
Hyperlink (Ctrl + K): This option links text, images, or objects to websites, other slides, or files.
Text Box: This option inserts a movable text box anywhere on the slide.
Video: This option inserts a video file from your computer or online sources into the slide.
Audio: This option inserts an audio file into the slide to enhance the presentation with sound.
30 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Rehearse Timings: This option allows users to practice and record the time spent on each slide for automated
slide progression.
Record Slide Show: This option records a slide show along with narration, annotations, and slide timings.
Show Media Controls: This option displays or hides video and audio playback controls during the slideshow.
31 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Introduction of MS Access
Microsoft Access is an application program that used for creating and managing databases. It allows users to
store, organize, and retrieve data efficiently. As a part of the Microsoft Office, it combines a graphical user
interface with robust database tools to facilitate the development of relational databases without requiring
advanced programming skills. MS Access supports designing tables, creating forms for data entry, generating
queries for data analysis, and building reports for presentation.
What is a Database?
A database is an organized collection of data that is stored, managed, and accessed electronically. It is
designed to efficiently store large volumes of data and allow for easy retrieval, modification, and
manipulation. Databases are commonly used in applications to manage information, such as customer records,
inventory, financial data, or any structured data set.
Types of Databases:
1. Relational Database:
o Organizes data into tables with predefined relationships (e.g., MS Access, MySQL, SQL
Server).
2. NoSQL Database:
o Designed for unstructured or semi-structured data (e.g., MongoDB, Cassandra).
3. Cloud Database:
o Hosted and managed on cloud platforms (e.g., Google Cloud SQL, Amazon RDS).
4. Flat-File Database:
o Stores data in a single file or table without complex relationships (e.g., CSV files).
32 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Key Features of MS Access
1. Table: A table in MS Access is the primary storage structure where data is organized into rows
(records) and columns (fields). Each field represents a specific attribute of the data, and each row
represents a single record. Tables are used to store raw data in a structured format.
2. Query: A query is a tool used to retrieve, filter, and manipulate data from one or more tables in MS
Access. Queries can be used to perform calculations, sort data, update records, or generate specific
results based on conditions.
3. Form: A form in MS Access is a user-friendly interface designed for data entry, editing, and viewing.
Forms allow users to interact with data in a visually appealing and structured way, often displaying
fields from a table or query in a customized layout.
4. Report: A report is a formatted output of data that is used for printing or sharing information.
Reports in MS Access are often used to summarize, group, and present data in a structured and
visually appealing manner.
MS Access Data Types and Their Definitions
1. Short Text
• Definition: Stores alphanumeric data (letters, numbers, and symbols) up to 255 characters.
• Example: Names, addresses, phone numbers, and product codes.
2. Long Text (Memo)
• Definition: Stores large amounts of text (up to 65,536 characters).
• Example: Notes, comments, detailed descriptions, or long messages.
3. Number
• Definition: Stores numeric values used for calculations.
• Example: Prices, quantities, IDs, and other numerical data.
4. Date/Time
• Definition: Stores dates and times in different formats.
• Example: Birthdates, appointment schedules, or timestamps (e.g., 12/31/2025, 10:30 AM).
5. Currency
• Definition: Stores monetary values with up to 4 decimal places, ensuring precise calculations.
• Example: $12.99, ₹500.50, €75.25
33 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
6. AutoNumber
• Definition: Automatically generates unique numbers for each record. It is commonly used as a
primary key.
• Example: 1, 2, 3, 4… (Sequential) or random numbers.
7. Yes/No (Boolean)
• Definition: Stores only two values: Yes/No, True/False, or On/Off.
• Example: A checkbox field for "Active Employee?" (✔ or ).
8. OLE Object
• Definition: Stores multimedia files like images, audio, videos, and documents.
• Example: Employee photos, company logos, PDFs, and Excel sheets.
9. Hyperlink
• Definition: Stores links to websites, email addresses, or file locations.
• Example: [Link] [Link]
10. Attachment
• Definition: Allows multiple files (images, documents, etc.) to be attached to a record.
• Example: A resume attached to an employee database.
11. Calculated
• Definition: Stores values that are automatically calculated using an expression or formula.
• Example: TotalPrice = Quantity * Price.
12. Lookup Wizard
• Definition: Creates a dropdown list by fetching values from another table or a predefined list.
• Example: A "Department" field pulling data from a "Departments" table.
34 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Step 2: Create the Required Tables
You need multiple tables to store different types of information.
1️. Creating the "Products" Table
1. Click Create tab → Table Design.
2. Add the following fields:
Field Name Data Type Description
ProductID AutoNumber (Primary Key) Unique product identifier
ProductName Short Text (255) Name of the product
Category Short Text (100) Type of product (e.g., Laptop, Desktop)
Brand Short Text (100) Manufacturer brand (e.g., Dell, HP)
Price Currency Selling price of the product
StockQuantity Number Available stock count
3. Set ProductID as the Primary Key.
4. Click Save, name the table as Products, and close it.
2️. Creating the "Customers" Table
1. Click Create tab → Table Design.
2. Add the following fields:
Field Name Data Type Description
CustomerID AutoNumber (Primary Key) Unique customer ID
CustomerName Short Text (255) Full name of the customer
35 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Field Name Data Type Description
SaleID AutoNumber (Primary Key) Unique sales transaction ID
CustomerID Number (Foreign Key) References Customers table
ProductID Number (Foreign Key) References Products table
QuantitySold Number Number of units sold
TotalAmount Currency Total amount for the sale
SaleDate Date/Time Date of transaction
3. Set SaleID as the Primary Key.
4. Click Save, name the table as Sales, and close it.
Step 3: Establish Relationships
1. Click the Database Tools tab → Relationships.
2. Add all three tables (Products, Customers, Sales).
3. Drag CustomerID from the Customers table to [Link] to create a relationship.
4. Drag ProductID from the Products table to [Link] to create another relationship.
5. Enforce Referential Integrity for both relationships.
6. Click Close and save the relationships.
Step 4: Create a Sales Form for Data Entry
1. Click the Create tab → Form Wizard.
2. Select the Sales table.
3. Add all fields except SaleID.
4. Choose a Columnar Layout and click Finish.
5. Save the form as SalesForm and close it.
Step 5: Create a Simple Sales Query
1. Click Create tab → Query Design.
2. Add the Sales and Products tables.
3. Add the fields: SaleDate, ProductName, QuantitySold, TotalAmount.
4. Run the query and save it as SalesReportQuery.
Step 6: Create a Sales Report
1. Click Create tab → Report Wizard.
2. Select SalesReportQuery as the data source.
36 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
3. Add all fields.
4. Choose a Tabular Layout.
5. Click Finish and name the report Sales Report.
Final Notes:
• To enter data, use the SalesForm for transactions.
• To view reports, open the Sales Report.
• To update inventory, edit the Products table.
37 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Introduction to Web Development
What is Web Development?
Web development is the process of creating and maintaining websites and web applications. It involves
designing, coding, and structuring websites using various programming languages, frameworks, and
technologies. Web development consists of three main components:
1. Front-End Development – Focuses on the user interface (UI) and experience (UX) using HTML,
CSS, and JavaScript.
2. Back-End Development – Handles server-side operations, databases, and application logic using
languages like PHP, Python, and [Link].
3. Full-Stack Development – Involves both front-end and back-end development, allowing a developer
to manage the entire web application.
Web development is essential for businesses, individuals, and organizations to establish their online presence
and offer services, information, and e-commerce solutions.
HTML, CSS, and JavaScript are the three pillars of web development.
1. HTML structures the content.
2. CSS styles the content.
3. JavaScript makes the content interactive.
Introduction to HTML
HTML (Hyper Text Markup Language) is the standard language used to create and structure web pages. It
defines the elements and content of a webpage using a system of tags and attributes. HTML was invented in
1990s by a scientist called TimBerners-Lee. The purpose was to make it easier for scientists at different
universities to gain access to each other’s research documents.
• HTML markup tags are usually called HTML tags
• HTML tags are keywords (tag names) surrounded by angle brackets like <html>
• HTML tags normally come in pairs like <b> and </b>
• The first tag in a pair is the start tag, the second tag is the end tag
• The end tag is written like the start tag, with a forward slash before the tag name
• Start and end tags are also called opening tags and closing tags
• <tagname>content</tagname>
Download Required Software
1. Download Google Chrome Browser from this link [Link]
2. Download VS Code from this link [Link]
3. Add Color Zilla Chrome Extension
4. Then install these extension
• Live Preview
• Prettier
• Vscode-icons (after install this extension press window + ; for insert any emoji in vs code)
38 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Versions of HTML
1. HTML1.0 (1993): Basic text formatting and links.
2. HTML2.0 (1995): Forms support added.
3. HTML3.2 (1997): Tables and applets introduced.
4. HTML4.01 (1999): CSS support added.
5. HTML5 (2014): Semantic elements, multimedia, and APIs added.
<h1> to <h6> Tags: The <h1> to <h6> tags in HTML are used to define headings in a webpage. These tags
help structure the content by providing different levels of headings, from most important (<h1>) to least
important (<h6>).
HTML <p> Tag: The <p> tag defines a paragraph.
Browsers automatically add a single blank line before and after each <p> element.
39 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Program Assignment
<h1>This is Heading1</h1>
<h2>This is Heading1</h2>
<h3>This is Heading1</h3>
<h4>This is Heading1</h4>
<h5>This is Heading1</h5>
<h6>This is Heading1</h6>
<p>Write Your Paragraph Here</p>
<p>Write Your Paragraph Here</p>
<p>Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet consectetur, adipisicing elit. Odit
consectetur, adipisicing elit. <br /> praesentium dolore adipisci vero in neque temporibus
Odit praesentium dolore adipisci vero in explicabo. Suscipit nulla laudantium reiciendis officiis iusto
neque temporibus explicabo. <br /> repellat sit labore assumenda.
Suscipit nulla laudantium reiciendis
officiis iusto repellat sit labore Lorem ipsum dolor sit amet consectetur, adipisicing elit. Odit
assumenda. praesentium dolore adipisci vero in neque temporibus
<br /> Doloribus ex soluta nobis explicabo. Suscipit nulla laudantium reiciendis officiis iusto
repellat sit labore assumenda.
illumrepellendus, molestiae id.</p>
Your’s Obediently
XYZ
40 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Project Coding Project (Output)
<h1>Best Company Laptop for Best Company Laptop for Coding
Coding</h1>
My Top 3 Company all the times
<h2>My Top 3 Company all the times</h2>
<h3>Hp Laptops</h3> Hp Laptops
<p>Lorem ipsum dolor sit amet consectetur, Lorem ipsum dolor sit amet consectetur, adipisicing elit.
adipisicing elit.</p>
Dell Laptops
<h3>Dell Laptops</h3> Lorem ipsum dolor sit amet consectetur, adipisicing elit.
<p>Lorem ipsum dolor sit amet consectetur,
adipisicing elit.</p> Lenovo Laptops
<h3>Lenovo Laptops</h3> Lorem ipsum dolor sit amet consectetur, adipisicing elit.
<p>Lorem ipsum dolor sit amet consectetur,
adipisicing elit.</p>
HTML <ol> and <ul> Tags in HTML
The <ol> (Ordered List) and <ul> (Unordered List) tags in HTML are used to create lists. Each item in the list
is represented using the <li> (List Item) tag.
• The <ol> tag is used to create an ordered list, where items are numbered or alphabetically arranged.
• The <ul> tag is used to create an unordered list, where items appear as bullets instead of numbers.
Ordered List Example Output UnOrdered List Example Output
<ol> 1. Ali <ul> • Ali
<li>Ali</li> 2. Ahmed <li>Ali</li>
• Ahmed
<li>Ahmed</li> <li>Ahmed</li>
3. Asad • Asad
<li>Asad</li> <li>Asad</li>
<li>Umair</li> 4. Umair <li>Umair</li> • Umair
</ol> </ul>
Nested Lists Example (Mixing <ol> and <ul>)
Practice Example Assignment
<ol>
<li>Fruits
<ul>
<li>Apple</li>
<li>Banana</li>
<li>Cherry</li>
</ul>
</li>
<li>Vegetables</li>
</ol>
41 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
HTML <img> Tag
The <img> tag in HTML is used to display images on a webpage. It is a self-closing (void) tag, meaning it
does not require a closing tag (</img> is incorrect).
Attributes of <img> Tag
1. src (Source) – Required
• Specifies the path of the image file.
• Can be a relative path (within the project) or an absolute URL.
Example – Using Local Image:
<img src="images/[Link]" alt="A beautiful sunset">
Example – Using Online Image:
<img src="[Link] alt="A beautiful sunset">
2. alt (Alternative Text) – Required for Accessibility & SEO
• Provides a text description for the image.
• Useful if the image fails to load.
• Improves SEO and helps visually impaired users.
42 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Project (Birthday) Invite
Project Programming Project Output
<h1>It's My Birthday!</h1>
<h2>On the 12th May</h2>
<h3>What to bring:</h3>
<ul>
<li>Baloons (I love baloons)</li>
<li>Cake (I'm really good at eating)</li>
<li>An appetite (There will be lots of food)</li>
</ul>
href="[Link]
ntry=ttu">Google map link</a>
What is File Path?
A file path describes the location of a file in a web site's folder structure. File paths are used when linking to
external files, like: (Web pages, Images, Style sheets, JavaScripts)
There are two types of Computer file paths
1. Absolute File Path: - URL paths in HTML can be absolute paths, like a full URL, for example:
[Link] C:/Project/Images/[Link], /Project/Images/[Link]
2. Relative File Path: - Relative file path are paths that links to a local file in the same folder or on the
same server, for example: ./about. html. ./style. css.
Files vs Folders Task (Programming) Task (Output)
<h1>All the Animals</h1> All the Animals
Rabbit
<h2>Rabbit:</h2>
<img src="./[Link]" alt="rabbit" />
Cat
<h2>Cat:</h2>
<img src="./Folder3/[Link]" alt="cat" />
Dog
<h2>Dog:</h2>
<img src="../[Link]" alt="dog" />
Fish
<h2>Fish:</h2>
<img src="../Folder1/[Link]" alt="fish" />
Bird
<h2>Bird:</h2>
<img src="../Folder1/Folder2/[Link]" alt="bird" />
43 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Resume Assignment
44 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
HTML <table> Tag: The <table> tag in HTML is used to create tables that organize and display data in a
structured format with rows and columns. It is commonly used to present tabular data on web pages.
Commonly Used Table Elements:
1. <table> – Defines the table.
2. <tr> – Defines a table row.
3. <th> – Defines a table header cell (bold and centered by default).
4. <td> – Defines a table data cell.
5. <caption> – Defines the table title or caption.
6. <thead> – Groups header content in a table.
7. <tbody> – Groups the body content in a table.
8. <tfoot> – Groups footer content in a table.
9. <col> – Specifies column properties for a group of columns.
Attributes of <table> Tag:
1. border – Defines the width of the table border.
2. cellpadding – Specifies the space between the content and the cell border.
3. cellspacing – Specifies the space between adjacent cells.
4. width – Defines the width of the table.
5. height – Defines the height of the table.
6. align – Aligns the table (deprecated in HTML5, use CSS instead).
7. bgcolor – Sets the background color of the table (deprecated in HTML5, use CSS instead).
Syntax
<table border="1" cellpadding="5" cellspacing="3"> <tr>
<caption>Student Marks</caption> <td>Jane</td>
<thead> <td>Science</td>
<tr> <td>85</td>
<th>Name</th> </tr>
<th>Subject</th> </tbody>
<th>Marks</th> <tfoot>
</tr> <tr>
</thead> <td colspan="2">Total</td>
<tbody> <td>175</td>
<tr> </tr>
<td>John</td> </tfoot>
<td>Math</td> </table>
<td>90</td>
</tr>
Forms & Input Tags
Forms are a very important part of HTML. It represents the document section containing interactive controls
for submitting information.
Whenever we add a <form> tag in the HTML, it is going to ask for some action for submitting that particular
form in the backend for future reference. So, for now, we will write it as [Link]. All the data submitted
in a form will be stored automatically in the backend “[Link]” after submitting it.
45 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Example Program
<h2>This is HTML form</h2>
<form action="[Link]">
<label for="name"> Name</label>
<div>
<input type="text" name="myName" id="name">
</div>
<br>
<div>
Role: <input type="text" name="myRole">
</div>
<br>
<div>
Email: <input type="email" name="myEmail">
</div>
<br>
<div>
Date: <input type="date" name="myDate">
</div>
<br>
<div>
Bonus: <input type="number" name="myBonus">
</div>
<br>
<div>
Select Any Course:
<input type="checkbox" name="myCourse">CIT
<input type="checkbox" name="myCourse">DIT
<input type="checkbox" name="myCourse">GRAPHIC DESIGN
<input type="checkbox" name="myCourse">WEB DEVELOPMENT
<input type="checkbox" name="myCourse">FREELANCING
</div>
<br>
<div>
Gender: Male <input type="radio" name="myGender"> Female <input type="radio" name="myGender">
Other <input type="radio" name="myGender">
</div>
<br>
<div>
Write about yourself: <br><textarea name="myText" cols="90" rows="10"></textarea>
46 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
</div>
<br>
<div>
<select>
<option>Select Any Course</option>
<option>Digital Literacy</option>
<option>Diploma in I. T</option>
<option>Graphic Design</option>
</select>
</div>
<br>
<div>
<input type="submit" value="Submit Now">
<input type="reset" value="Reset Now">
</div>
</form>
47 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Ids & Classes in HTML
In HTML, IDs and Classes are attributes used to identify and style elements on a webpage. They are
commonly used with CSS and JavaScript to apply styles or manipulate elements.
[Link] (id)
• An ID is a unique identifier for a single HTML element on a page.
• No two elements can share the same ID within the same document.
• IDs are used to target a specific element for styling or scripting.
• In CSS, an ID is referenced with a # (hash) symbol.
Example:
HTML CSS
#unique-paragraph {
color: blue;
<p id="unique-paragraph">This is a unique paragraph.</p>
font-size: 18px;
}
2. Class (class)
• A Class is used to group multiple elements that share the same characteristics or styling.
• Unlike IDs, multiple elements can have the same class.
• Classes are reusable and can be applied to as many elements as needed.
• In CSS, a class is referenced with a . (dot) symbol.
Example:
HTML CSS
.highlight {
<p class="highlight">This is a highlighted paragraph.</p> background-color: yellow;
<p class="highlight">This is another highlighted paragraph.</p> font-weight: bold;
}
HTML Entities
HTML Entities are special codes used to represent characters that cannot be typed directly or have special
meanings in HTML. They are often used to display reserved characters (like <, >, &, etc.) or symbols (like ©,
€, etc.)
Syntax of HTML Entities
HTML entities start with an ampersand (&) and end with a semicolon (;). They can be written in two ways:
1. Named Entities: Use a predefined name (e.g., < for <).
2. Numeric Entities: Use a numeric code (decimal or hexadecimal) (e.g., < for <).
Practice Program
<p>Use < and > to enclose HTML tags.</p>
<p>The ampersand symbol is &.</p>
<p>Copyright © 2025 | Dawn Institute of I.T</p>
<p>The price is €10.</p>
<p>This is a sentence with extra spaces.</p>
48 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Common HTML Entities
Character Description Named Entity Numeric Entity (Decimal)
< Less-than sign < <
> Greater-than sign > >
& Ampersand & &
" Double quotation mark " "
' Single quotation mark ' '
Non-breaking space  
© Copyright symbol © ©
® Registered trademark ® ®
€ Euro currency symbol € €
× Multiplication sign × ×
÷ Division sign ÷ ÷
Introduction to CSS
CSS (Cascading Style Sheets) is a stylesheet language used to control the presentation and layout of
HTML elements. It allows web developers to style web pages by defining colors, fonts, spacing, alignment,
animations, and responsiveness.
Why Use CSS?
• Separation of Content and Design: Keeps HTML structure clean and styles separate.
• Improves Readability and Maintainability: Easier to update styles across multiple pages.
• Supports Responsive Design: Helps web pages adapt to different screen sizes.
CSS Syntax
49 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Types of CSS
There are three ways to apply CSS to an HTML document:
1. Inline CSS: CSS is added directly within an HTML element using the style attribute.
Example: <p style="color: blue; font-size: 20px;">This is inline CSS. </p>
Pros: Quick and easy for single elements.
Cons: Hard to maintain for large projects.
2. Internal CSS (Embedded CSS): CSS is written inside a <style> tag in the <head> section of the HTML
document.
Example: <style>
p{
color: green;
font-size: 18px;
}
</style>
Pros: Useful for styling a single page.
Cons: Not reusable across multiple pages.
3. External CSS: CSS is written in a separate file ([Link]) and linked using <link>.
Example:
[Link] Syntax to Link [Link] with HTML
p{
color: purple;
<link rel="stylesheet" href="[Link]">
font-size: 18px;
}
Pros: Best for large projects; makes CSS reusable.
Cons: Requires an extra HTTP request.
Comments in HTML and CSS
Comments are used in HTML and CSS to add notes, explanations, or temporary code without affecting the actual
output. They help developers understand and organize code.
Syntax (HTML Comments) Syntax (CSS Comments)
<! -- This is an HTML comment --> /* This is a CSS comment */
Selectors in CSS
CSS (Cascading Style Sheets) selectors are used to target and style HTML elements. Here are the basic types of
CSS selectors:
1. Universal Selector (*): Selects all elements on the page.
2. Type Selector (Element Selector): Selects all elements of a specific type.
3. Class Selector (.class): Selects elements with a specific class attribute.
4. ID Selector (#id): Selects a single element with a specific ID attribute.
5. Grouping Selectors: Combines multiple selectors to apply the same styles.
50 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
HTML Programming CSS Programming
<h1>This is a Heading</h1> /* Usage of ID Selector */
<h2 id="heading">Dawn Institute of I.T Sarhad</h2> #heading {
<p class="para">Some Text</p> border: 2px solid black;
<p class="para">Some Text</p> }
<h3>This is Heading3</h3>
<span>This is Span Text</span> /* Usage of Class Selector */
CSS Programming .para {
<style> background-color: blue;
/* Usage of Universal Selector */ color: yellow;
*{ }
font-family: Arial, Helvetica, sans-serif;
} /* Usage of Grouping Selector */
h3,
/* Usage of Element Selector */ span {
border: 2px solid red;
h1 {
background-color: red; }
</style>
color: white;
}
51 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Colors in CSS
Colors in CSS are used to style text, backgrounds, borders, and other elements. CSS allows colors to be
defined using different formats, including names, RGB, HEX, HSL, and more.
Ways to Define Colors in CSS
1. Named Colors: CSS provides 140 predefined color names such as red, blue, green, black, etc.
Example: h1 {color: red;}
2. HEX (Hexadecimal) Colors: A HEX code represents a color using a # symbol followed by six characters
(combining red, green, and blue values).
Example: h1 {color: #RRGGBB;}
3. RGB (Red, Green, Blue) Colors: RGB defines colors using three values for red, green, and blue, each
ranging from 0 to 255.
Example: h1 {color: rgb(255, 0, 0); /* Red */ }
p {background-color: rgb(0, 255, 0); /* Green */ }
4. HSL (Hue, Saturation, Lightness) Colors: HSL defines colors using hue (color), saturation (intensity),
and lightness (brightness).
Example: h1 {
color: hsl(240, 100%, 50%); /* Blue */
}
Fonts in CSS
In CSS, fonts control the text's appearance on a webpage. You can define fonts using various properties to set
the typeface, size, weight, style, and other aspects of text formatting.
1. Font Properties in CSS
Here are the key font-related properties in CSS:
• font-family: Specifies the font type for an element. Example Values: (Arial, Time New Roman)
• font-size: Defines the size of the text. Can use different units like (px, pt, cm, %, em, rem, vw)
• font-weight: Specifies the thickness of the text. Example Values: normal, bold, lighter, bolder
• font-style: Defines whether the text is normal, italic, or oblique.
• font-variant: Controls small caps styling. Example Value: small-caps
• line-height: Controls the spacing between lines of text. Example Values: 1.5, 2, 3
• letter-spacing: Adjusts spacing between characters. Example Values: 2px, 4px
• word-spacing: Controls the space between words. Example Values: 5px, 10px
2. Shorthand Property: font
Example: p {font: italic bold 16px "Arial", sans-serif;}
Types of Fonts
In CSS, we have two types of fonts- web-safe fonts and web fonts. Web safe fonts are the fonts that come pre-installed
with most of the operating systems, therefore, using these fonts you will never encounter any error. But on the other
hand, some fonts are not shipped with the OS. So, to use them, we need to import them from the web.
Example to use Web Safe Fonts: p{font-family:Arial;}
Example to use Web Fonts: Visit this site and copy google fonts link: [Link]
52 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Borders in CSS
Borders in CSS define the outline around an element. You can customize their width, style, and color to
enhance the appearance of elements.
1. Border Properties in CSS→ border (Shorthand Property): The border shorthand sets the width, style,
and color in one line.
Example: div {border: 2px solid red;}
Breakdown:
• 2px → Border width
• solid → Border style (Value used: solid, dotted, dashed, double)
• red → Border color
2. Individual Borders (Top, Right, Bottom, Left): You can set borders separately for each side:
Example: div {
border-top: 2px solid red;
border-right: 3px dashed blue;
border-bottom: 4px double green;
border-left: 5px groove orange;
}
3. Rounded Borders (border-radius): The border-radius property creates rounded corners.
Example: div {
border: 2px solid black;
border-radius: 10px;
}
Different values for each corner:
Example: div {
border-radius: 10px 20px 30px 40px; /* top-left, top-right, bottom-right, bottom-left */
}
4. Border with Images (border-image): You can use images as a border.
Example: div {
border: 20px solid transparent;
border-image: url("[Link]") 30 round;
}
Example ([Link]) CSS Programming
div {
height: 300px;
border: 2px solid red;
/* border-top: 2px solid red;
border-right: 3px dashed blue;
border-bottom: 4px double green;
<div>lorem100</div>
border-left: 5px groove orange; */
/* border-radius: 40px; */
/* border-radius: 10px 20px 30px 40px; */
border: 20px solid transparent;
border-image: url("[Link]") 30 round;
}
53 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Backgrounds in CSS
CSS backgrounds allow you to control the appearance of the background of an element, including colors,
images, positioning, and effects.
Background Properties in CSS
1. background-color: Sets the background color of an element. Values: red, green
2. background-image: Sets an image as the background and also you can use linear-gradient () or radial-
gradient () instead of an image:
3. background-repeat: Controls if and how the background image repeats.
Values: → repeat (default) → Repeats both horizontally & vertically. → repeat-x → Repeats
horizontally. → repeat-y → Repeats vertically. → no-repeat → No repetition.
4. background-position: Defines the starting position of the background image.
Accepts values like: → Keywords: top, bottom, left, right, center
→ Pixels: 50px 100px (x, y) →Percentages: 50% 50% (center)
5. background-size: Defines the size of the background image.
Values: → auto (default) → Keeps original size. →cover → Stretches to cover the entire element.
→ contain → Ensures the whole image fits inside. → Custom values: 100px 200px
6. background-attachment: Controls if the background scrolls with the page or stays fixed.
Values: → scroll→ Background moves when scrolling. → fixed → Background stays in place.
→ local → Moves when the element's content is scrolled.
7. background-clip: Defines how far the background extends.
Values: → border-box→ Extends to the border. →padding-box → Inside the padding, not the border.
→content-box → Inside only the content area.
8. background-blend-mode: Specifies how the background image and color blend.
Values: → multiply, screen, overlay, darken, lighten
background (Shorthand Property): The background property allows multiple background settings in one
line:
Example: div {background: url("[Link]") no-repeat center center / cover fixed;}
54 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
CSS Box Model
The CSS Box Model is the fundamental concept that defines how elements are structured and spaced on a
webpage. Every HTML element is treated as a rectangular box with the following layers:
1. Content – The actual content (text, images, etc.).
2. Padding – Space between the content and the border.
3. Border – The outline surrounding the padding and content.
4. Margin – Space outside the border, separating elements.
Box Model Properties in CSS
1. width & height (Content Area):
Defines the size of the content inside the box.
2. padding (Inner Spacing): Adds space between content and border.
3. border (Outline of the Box): Defines the border around the element.
4. margin (Outer Spacing): Creates space between elements.
5. box-sizing: The box-sizing property controls how the total width and height of an element are
calculated, including padding and border.
Example ([Link]) CSS Programming
.box{
display: inline-block;
box-sizing: border-box;
width: 30%;
border: 2px solid black;
<div class="box">lorem100</div> /* padding: 20px; */
<div class="box">lorem100</div> padding: 5px 20px; /* Y Axis X Axis*/
<div class="box">lorem100</div> padding: 5px 10px 15px 20px; /* Top Right Bottom Left */
/* margin: 20px; */
margin: 5px 20px; /* Y Axis X Axis*/
margin: 5px 10px 15px 20px; /* Top Right Bottom Left */
}
55 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Example: ([Link]) CSS Programming
<div class="cat"> div {
<h2>CatCSS</h2> display: inline-block;
width: 40%;
<img src="[Link]" alt="cat in a box" />
}
<p class="first-paragraph">lorem100</p> img {
</div> float: left;
}
<div class="dog">
p{
<h2>DogCSS</h2> font-size: 2em;
<img src="[Link]" alt="dogs in a box" /> }
.cat {
<p class="second-paragraph">lorem100</p>
background-color: aquamarine;
</div> float: left;
<footer>Copyright. This is the footer</footer> }
.dog {
background-color: coral;
float: right;
}
footer {
text-align: center;
background-color: blueviolet;
clear: both;
}
Alternative to float: flexbox & grid: Since float was originally designed for text wrapping, Flexbox and CSS
Grid are now preferred for modern layouts.
Styling Links & Buttons in CSS
Styling links and buttons in CSS involves customizing their appearance using properties like color,
background, borders, and animations. Links can have different styles for states like hover and active, while
buttons can be enhanced with padding, gradients, and effects. This improves user experience and design
aesthetics.
Example: ([Link]) Programming CSS Programming
body {text-align: center;} /* Hover state */
<a href="#" class="btn">Home</a> a {text-decoration: none;} .btn:hover {
<a href="#" class="btn">About</a> .btn {font-family: Arial; background-color: rgb(0, 0,
font-size: 20px; 122);
<a href="#" class="btn">Our Courses</a> padding: 5px 14px; color: yellow;
<button class="btn">Gallery</button> margin: 15px -1px; cursor: pointer;
background-color: red; }
<button class="btn">Apply Online</button> color: white; /* Active state (being clicked) */
border: none; .btn:active {
<button class="btn">Contact</button>
} background-color: green;
color: white;
}
56 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Usage of Display Property in CSS
The display property in CSS determines how an element is rendered in the document flow. It defines whether
an element behaves as a block, inline, flex, grid, or other layout models.
Why Convert Inline to Block and Block to Inline?
Sometimes, CSS layouts cause problems due to the default behavior of inline and block elements.
By changing their display property, we can fix alignment issues, control size, and improve design.
Let's go through common problems and their solutions with examples.
1. Problem: Can’t Set Width/Height on Inline Elements
By default, inline elements (like <span>, <a>) don’t accept width/height.
Solution: Convert them to block or inline-block.
2. Problem: Block Elements Don’t Stay in One Line
By default, block elements (like <div>, <p>) always start on a new line.
Solution: Convert them to inline or inline-block.
Problem#1 (Solution) Problem#2 (Solution)
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<style> <style>
. inline-fix { . block-fix {
display: block; /* Converted inline to block */ display: inline; /* Converted block to inline */
background-color: lightblue; background-color: lightcoral;
width: 200px; padding: 10px;
height: 50px; }
text-align: center; </style>
line-height: 50px; </head>
} <body>
</style> <div class="block-fix">Box 1</div>
</head> <div class="block-fix">Box 2</div>
<body> <div class="block-fix">Box 3</div>
<span class="inline-fix">Now I'm a Block</span> </body>
</body> </html>
</html>
3. Problem: Buttons or Links Have Uncontrollable Size
Anchor tags (<a>) are inline by default, so width/height doesn’t apply properly.
Solution: Use inline-block to allow full control.
Problem#3 Solution ([Link]) Programming CSS Programming
. button-fix {display: inline-block;
background-color: green;
color: white;
<a href="#" class="button-fix">Click Me</a> padding: 10px 20px;
text-decoration: none;
width: 150px; /* Width works now */
text-align: center; }
57 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
CSS position Property – Definition & Explanation
The position property in CSS is used to control the placement of an element on a webpage. It defines how
an element should be positioned relative to its normal flow, its parent, or the entire viewport.
There are five types of position property:
1. static: It is the default position of HTML elements.
2. relative: The element is positioned relative to itself (its original position). You can move it using top, left, right,
bottom without affecting other elements.
3. absolute: An element with the absolute position will move according to the position of its parent element.
(relative, absolute, or fixed).
4. fixed: The element is fixed relative to the viewport (screen). It does not move when scrolling.
5. sticky: The element behaves like relative until a certain scroll position is reached. Then, it sticks like fixed.
Relative Position Example ([Link]) CSS (Programming)
.box { position: relative;
left: 50px; /* Moves 50px right */
<div class="box">I am a relatively positioned box</div> top: 20px; /* Moves 20px down */
background-color: lightblue;
padding: 20px; }
Absolute Position Example ([Link]) CSS (Programming)
.container {
position: relative; /* The parent is now a reference */
width: 300px;
height: 200px;
background-color: lightgray;
<div class="container"> <div class="box">I am an
}
absolute box</div> </div>
.box { position: absolute;
top: 50px;
left: 30px;
background-color: orange;
padding: 20px; }
Fixed Position Example ([Link]) CSS (Programming)
.box { position: fixed;
top: 20px;
<div class="box">I am a fixed box</div>
right: 20px;
<p>Scroll the page, and I will stay fixed.</p>
background-color: red;
<p style="height: 2000px;"></p>
color: white;
padding: 10px; }
Sticky Position Example ([Link]) CSS (Programming)
.box { position: sticky;
<div class="box">I am a sticky box</div> top: 0; /* Sticks at the top when scrolling */
<p>Scroll down, and I will stick to the top.</p> background-color: green;
<p style="height: 2000px;"></p> color: white;
padding: 10px; }
58 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Difference Between visibility: hidden; and display: none; in CSS
Both visibility: hidden; and display: none; are used to hide elements in CSS, but they behave differently.
Property = Effect
visibility: hidden; = Hides the element, but it still takes up space in the layout.
display: none; = Hides the element completely and removes it from the layout.
Example: ([Link]) CSS Programming
. box {
<div class="box">Visible Box</div> width: 200px;
<div class="box hidden-box">Hidden Box</div> height: 100px;
<div class="box none-box">Hidden Box</div> background-color: red;
color: white;
<div class="box">Another Visible Box</div> text-align: center;
line-height: 100px;
margin:5px;}
. hidden-box {visibility: hidden;}
. none-box {display: none;}
CSS z-index Property
The z-index property in CSS controls the stacking order of overlapping elements. It determines which element
appears in front and which goes behind when elements overlap.
Key Points About z-index:
• Higher z-index values place elements in front of elements with lower z-index values.
• Z-index does not work on static position value. It only works on the elements with position: relative, absolute,
fixed, or sticky.
Example: ([Link]) CSS Programming
. box { . box1 {
width: 150px; background-color: red;
height: 150px; top: 50px;
position: absolute; left: 50px;
color: white; z-index: 1;
<div class="box box1">Box 1</div> text-align: center; }
<div class="box box2">Box 2</div> line-height: 150px; . box2 {
font-size: 18px; background-color: blue;
font-weight: bold; top: 100px;
} left: 100px;
z-index: 2; /* Higher value, appears on top */
}
59 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
CSS Flexbox
What is a Flexbox?
• Flexbox is a one-dimensional layout method for laying out items in rows or columns.
• CSS flexbox is a better way to align items into a container.
Why Use Flexbox?
Align items easily (horizontal & vertical centering).
Distribute extra space dynamically.
Make items responsive without using floats or positioning.
Handles different screen sizes efficiently.
60 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
4. Flex Wrap (Handling Overflow): flex-wrap controls whether items wrap to the next row/column
when there's not enough space.
Available Values Effect
nowrap (Default) Items stay on one line (may overflow).
wrap Items wrap to the next line when needed.
wrap-reverse Items wrap in reverse order.
Flex Container Properties
1. Align Self (Individual Item Alignment):
Use align-self to override align-items for a specific flex item.
Example: item-1 {align-self: flex-end;}
2. Flex Grow, Shrink, Basis
• flex-grow (Controls how much space an item takes)
• flex-shrink (Controls how much an item shrinks)
• flex-basis (Sets default size before growing/shrinking)
Example-1 (HTML Programming) Update Example-1 (CSS Programming)
<div class="container"> .container {background-color: antiquewhite;
<div class="box" id="box-1"></div> border: 2px solid black;
<div class="box" id="box-2"></div> height: 500px;
<div class="box" id="box-3"></div> display: flex;
<div class="box" id="box-4"></div> flex-wrap: wrap;
</div> }
Example-1 (CSS Programming) . box {height: 150px;
.container { width: 150px;
background-color: antiquewhite; margin: 3px;
border: 2px solid black; background-color: red;
height: 500px; }
display: flex; #box-2{ /* align-self: flex-end; */
justify-content: space-between; flex-basis: 150px;
align-items: center; flex-grow: 1;
flex-wrap: wrap; } flex-shrink: 1;
}
. box {
#box-3{flex-basis: 150px;
height: 150px;
flex-grow: 2;
width: 150px;
flex-shrink: 2;
border: 2px solid black;
}
background-color: red;
}
61 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
CSS Units: em, rem, vh, and vw Explained
CSS offers different units for setting sizes like font size, width, height, padding, and margins. Among them,
em, rem, vh, and vw are widely used for responsive designs.
1. em (Relative to Parent Font Size): The em unit is relative to the font size of the parent element.
Example: (HTML Programming) CSS (Programming)
<div class="parent"> . parent{
<div class="child">This is a Paragraph</div> font-size: 10px;
</div> }
.child{
font-size: 5em; /* 5× 10px = 50px */
}
The. child text will have a font size of 50px, because 5em means 5 times the font size of .parent (which is 50px).
2. rem (Relative to Root Font Size): The rem unit is relative to the font size of the root (<html>) element.
Example: (HTML Programming) CSS (Programming)
html{
<div class="parent"> font-size 20px; /* Default browser font size */
. parent{
<div class="child">This is a Paragraph</div>
font-size: 10px;
</div> }
.child{
font-size: 2rem; /* 2 × 20px = 40px */
}
Effect: The .child font size will be 40px, regardless of .parent, because rem is always relative to <html>.
3. vh (Viewport Height): The vh unit represents a percentage of the viewport's height (browser window
height).
Example: (HTML Programming) CSS (Programming)
. full-screen {
<div class="full-screen"> </div> background-color: green;
height: 100vh; }
Effect: The .full-screen div will always be as tall as the entire browser window.
4. vw (Viewport Width): The vw unit represents a percentage of the viewport's width (browser window
width).
Example: (HTML Programming) CSS (Programming)
.full-width {background-color: green;
<div class="full-width">
height: 100vw;}
<div class="child">Some Text Goes Here</div> .child{ font-size: 5vw;
</div> color: white;
text-align: center; }
The .full-width div will always be as wide as the entire browser window.
62 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Media Query in CSS
A media query in CSS allows you to apply styles based on the screen size, resolution, or device type. It
helps make websites responsive, ensuring they look good on all devices (mobile, tablet, desktop).
Basic Syntax of a Media Query
@media (condition) {
/* CSS rules for that condition */
}
Media Query Conditions
You can specify different conditions using:
• Screen Width (max-width, min-width)
• Device Type (screen, print, all)
• Aspect Ratio, Resolution, and more
Common Width-Based Media Queries
Screen Type Width Media Query
Mobile max-width: 600px @media (max-width: 600px) {/* CSS rules for that condition */}
Tablet max-width: 768px @media (max-width: 768px) {/* CSS rules for that condition */}
Desktop min-width: 1024px @media (min-width: 1024px) {/* CSS rules for that condition */}
63 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
CSS ::before and ::after Pseudo-Elements
What are ::before and ::after?
::before and ::after are CSS pseudo-elements that let you insert content before or after an element's actual
content without modifying the HTML.
• They are used with content property.
• They don't exist in the DOM but appear visually.
• Useful for decorative elements, icons, labels, animations, etc.
Example-1 (HTML Programming) Example-2 (HTML Programming)
<button class="button">Click Me</button> <span class="product">Smartphone</span>
<span class="product">Tablet</span>
<span class="product">Anroid Phone</span>
CSS Programming CSS Programming
.button{ .product {font-size: 40px;}
font-size: 30px; .product::before {
} content: "New! ";
.button::before { color: white;
content: " "; background-color: red;
} padding: 4px;
.button::after {content: " ";} border-radius: 5px;
font-size: 40px; }
Show Tooltip on Hover (Using :hover and ::after)
Example-1 (HTML Programming) Example-2 (HTML Programming)
<label class="required">Name</label>
<input type="text" name="" id="">
<span class="tooltip">Hover me</span>
<label class="required">Father's Name</label>
<input type="text" name="" id="">
CSS Programming CSS Programming
.tooltip::after { [Link]::after {
content: "Helpful Info"; content: " *";
position: absolute; color: red;
background-color: black; font-weight: bold;
color: white; }
padding: 5px;
border-radius: 3px;
font-size: 40px;
opacity: 0;
transition: opacity 0.3s;}
.tooltip:hover::after {
opacity: 1;}
64 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
CSS box-shadow and text-shadow
CSS provides shadows to enhance visual appearance. Two commonly used shadow properties are:
• box-shadow → Adds shadows to elements (like buttons, cards, divs).
Syntax: box-shadow: offset-x offset-y blur-radius spread-radius color;
• text-shadow → Adds shadows to text (like glowing text effects).
Syntax: text-shadow: offset-x offset-y blur-radius color;
Example: (HTML Programming) . glow-button {
<div class="card"> background: black;
<h1 class="neon-text">This is a Card</h1> color: cyan;
<p>Card Description Here</p> padding: 15px 30px;
<button class="glow-button">Glowing Button</button> font-size: 18px;
</div> border: none;
CSS Programming cursor: pointer;
.card { box-shadow: 0px 0px 10px cyan;
width: 300px; }
padding: 20px; . neon-text {
background: white; color: blue;
box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.2); text-shadow: 0px 0px 10px blue;
border-radius: 10px; }
}
.button {
background: blue;
color: white;
padding: 10px 20px;
font-size: 16px;
border: none;
cursor: pointer;
}
65 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
CSS (Programming)
:root { button {
--primary-color: #3498db; background-color: var(--secondary-color);
--secondary-color: #2ecc71; color: white;
--font-size: 16px; padding: 10px 20px;
} border: none;
body { cursor: pointer;
background-color: var(--primary-color); }
color: white;
font-size: var(--font-size);
}
Animation Property in CSS
The animation property in CSS allows you to create smooth transitions and animations without using
JavaScript or external libraries. It enables elements to change styles over a specified duration.
Key Components of CSS Animation
To create an animation, you need two main things:
1. @keyframes Rule – Defines the animation behavior.
2. animation Property – Applies the animation to an element.
Example-1 (HTML Programming) Example-2 (HTML Programming)
<body> <body>
<div class="box"></div> <div class="ball"></div>
</body> </body>
Example-1 (CSS Programming) Example-2 (CSS Programming)
@keyframes slideIn { @keyframes bounce {
from { 0% {transform: translateY(0);
transform: translateX(-100px); background-color: blue;
opacity: 0;
}
}
to { 50% {transform: translateY(-50px);
transform: translateX(0); background-color: red;
opacity: 1; }
} 100% {transform: translateY(0);
} background-color: blue;
}
.box {
}
width: 100px;
height: 100px; .ball { width: 50px;
background-color: blue; height: 50px;
animation: slideIn 2s ease-in-out; background-color: red;
} border-radius: 50%;
animation: bounce 1s ease-in-out infinite;
}
66 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Transition Property in CSS
The transition property in CSS allows smooth animations when changing CSS properties. Instead of an instant
change, transition makes it gradual, improving user experience.
Syntax: selector {
transition: property duration timing-function delay;
}
Shorthand Example: button {
transition: background-color 0.5s ease-in-out;
}
Example-1 (HTML Programming) Example-3 (HTML Programming)
<body>
<button>Test Button</button> <img src="./[Link]" alt="Flowers">
</body>
Example-1 (CSS Programming) Example-3 (CSS Programming)
button { img {
background-color: #3498db; width: 200px;
color: white; transition: transform 0.5s ease-in-out;
padding: 10px 20px; }
border: none;
cursor: pointer; img:hover {
transition: background-color 0.5s ease; transform: scale(1.2);
} }
button:hover {
background-color: #e74c3c;
}
Example-2 (HTML Programming) Example-4 (HTML Programming)
<body> <body>
Search<input type="search" name="" id=""> <div class="sidebar"></div>
</body> </body>
Example-2 (CSS Programming) Example-4 (CSS Programming)
body{font-size: 25px;} .sidebar {
input { width: 50px;
width: 100px; height: 100vh;
padding: 5px; background: #2c3e50;
border: 1px solid gray; transition: width 0.5s;
transition: width 0.4s ease; }
} .sidebar:hover {
input:focus { width: 200px;
width: 200px; }
}
67 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
CSS transform Property
The transform property in CSS allows elements to be visually manipulated, including rotation, scaling,
translation, and skewing. It enables dynamic and interactive UI effects without affecting the document flow.
Types of Transformations
1. Translate: Moves an element along the X or Y axis without affecting other elements.
2. Rotate (Rotate an Element): Rotates an element by a specified degree.
3. Scale (Resize an Element): Increases or decreases the size of an element.
4. Skew (Tilt an Element): Tilts an element along the X or Y axis.
Example-1 (HTML Programming) Example-2 (HTML Programming)
<body>
<body>
<div class="loader"></div>
<div class="box"></div>
<p>Loading...</p>
</body>
</body>
Example-2 (CSS Programming) Example-2 (CSS Programming)
body { body {
height: 100vh; height: 100vh;
display: flex; display: flex;
justify-content: center; flex-direction: column;
align-items: center; justify-content: center;
} align-items: center;
.box { }
height: 200px; .loader {
width: 200px; width: 50px;
background-color: red; height: 50px;
transition: transform 0.3s ease-in-out; border: 10px solid gray;
} border-top: 10px solid blue;
.box:hover { border-radius: 50%;
/* transform: translate(50px, 50px); */ animation: spin 1s linear infinite;
/* transform: rotate(360deg); */ }
/* transform: scale(1.5); */ @keyframes spin {
/* transform: skew(20deg); */ 100% {
/* transform: skew(20deg); */ transform: rotate(360deg);
}
/* Combining Multiple Transformations */ }
transform: rotate(360deg) scale(1.5) translate(20px, p{
20px); font-size: 20px;
} font-family: Arial, Helvetica, sans-serif;
}
68 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Creating Responsive Navigation Bar using (Flexbox)
69 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
CSS Grid Layout
CSS Grid is a powerful layout system that allows developers to design web pages using rows and columns. It
provides better control over layouts than traditional methods like floats or flexbox.
Basic Syntax
.container {
display: grid;
grid-template-columns: 1fr 2fr 1fr; /* Three columns */
grid-template-rows: auto auto; /* Two rows */
gap: 10px; /* Space between grid items */
}
Each child of .container automatically becomes a grid item.
Example-1 (HTML Programming) Example-2 (HTML Programming)
<div class="container">
<div class="container">
<div class="header">Header</div>
<div class="box">Box</div>
<div class="sidebar">Sidebar</div>
<div class="box">Box</div>
<div class="content">Content</div>
<div class="box">Box</div>
<div class="footer">Footer</div>
</div>
</div>
Example-1 (CSS Programming) Example-2 (CSS Programming)
.container { .container {display: grid;
display: grid; grid-template-areas:
/* grid-template-columns: 300px 100px 100px; */ "header header"
/* grid-template-columns: 300px auto 100px; */ "sidebar content"
/* grid-template-columns: 1fr 4fr 1fr; */ "footer footer";
grid-template-columns: repeat(3, auto); grid-template-columns: 1fr 3fr;
grid-gap: 2rem; grid-template-rows: auto 1fr auto;}
} .header {grid-area: header;
.box{ background: #333;
background-color: red; color: white;
font-size: 20px; padding: 20px;}
padding: 15px; .sidebar {grid-area: sidebar;
} background: lightgray;
padding: 20px;}
.content {grid-area: content;
padding: 20px;}
.footer {grid-area: footer;
background: #333;
color: white;
padding: 20px;
}
70 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Fully Responsive Website Project Using HTML & CSS
HTML Programming ([Link])
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Best Online Food Delivery Service in Pakistan | [Link]</title>
<link rel="stylesheet" href="css/[Link]">
<link rel="stylesheet" media="screen and (max-width: 1170px)" href="css/[Link]">
<link href="[Link] rel="stylesheet">
</head>
<body>
<nav id="navbar">
<div id="logo">
<img src="[Link]" alt="[Link]">
</div>
<ul>
<li class="item"><a href="#home">Home</a></li>
<li class="item"><a href="#services-container">Services</a></li>
<li class="item"><a href="#client-section">Our Clients</a></li>
<li class="item"><a href="#contact">Contact Us</a></li>
</ul>
</nav>
<section id="home">
<h1 class="h-primary">Welcome to MyOnlineMeal</h1>
<p>lorem12 </p>
<p>lorem8 </p>
<button class="btn">Order Now</button>
</section>
<section id="services-container">
<h1 class="h-primary center">Our Services</h1>
<div id="services">
<div class="box">
<img src="img/[Link]" alt="">
<h2 class="h-secondary center">Food Catering</h2>
<p class="center">lorem100</p>
</div>
<div class="box">
<img src="img/[Link]" alt="">
<h2 class="h-secondary center">Bulk Ordering</h2>
<p class="center">lorem100</p>
</div>
<div class="box">
<img src="img/[Link]" alt="">
<h2 class="h-secondary center">Food Ordering</h2>
<p class="center">lorem100</p>
</div>
71 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
</div>
</section>
<section id="client-section">
<h1 class="h-primary center">Our Clients</h1>
<div id="clients">
<div class="client-item">
<img src="img/[Link]" alt="Our Client">
</div>
<div class="client-item">
<img src="img/[Link]" alt="Our Client">
</div>
<div class="client-item">
<img src="img/[Link]" alt="Our Client">
</div>
<div class="client-item">
<img src="img/[Link]" alt="Our Client">
</div>
</div>
</section>
<section id="contact">
<h1 class="h-primary center">Contact Us</h1>
<div id="contact-box">
<form action="[Link]">
<div class="form-group">
<label for="name">Name: </label>
<input type="text" name="name" id="name" placeholder="Enter your name">
</div>
<div class="form-group">
<label for="email">Email: </label>
<input type="email" name="name" id="email" placeholder="Enter your email">
</div>
<div class="form-group">
<label for="phone">Phone Number: </label>
<input type="phone" name="name" id="phone" placeholder="Enter your phone">
</div>
<div class="form-group">
<label for="message">Message: </label>
<textarea name="message" id="message" cols="30" rows="10"></textarea>
</div>
</form>
</div>
</section>
<footer>
<div class="center">
Copyright © 2025 | MyOnlineMeal | All rights reserved!
</div>
</footer>
</body>
</html>
72 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
CSS Programming ([Link])
/* CSS Reset */ #navbar ul li a:hover {
*{ color: black;
margin: 0; border-radius: 5px;
padding: 0; background-color: white;
} }
html { /* Home Section */
scroll-behavior: smooth; #home {
} /* border: 2px solid red; */
/* Navigation Bar */ display: flex;
#navbar { flex-direction: column;
display: flex; padding: 3px 200px;
align-items: center; height: 550px;
position: sticky; justify-content: center;
top: 0px; align-items: center;
flex-direction: row; }
} #home::before {
#navbar::before { content: "";
content: ""; position: absolute;
background-color: black; background: url('../[Link]') no-repeat center
position: absolute; center/cover;
top: 0px; height: 642px;
left: 0px; top: 0px;
height: 100%; left: 0px;
width: 100%; width: 100%;
z-index: -1; z-index: -1;
opacity: 0.7; opacity: 0.7; }
} #home h1 {
/* Navigation Bar: Logo and Image */ color: white;
#logo { text-align: center;
margin: 10px 34px; font-size: 2rem;
} font-family: 'Bree Serif', serif;
#logo img { }
height: 59px; #home p {
margin: 3px 6px; color: white;
} text-align: center;
/* Navigation Bar: List Styling */ font-size: 1.5rem;
#navbar ul { font-family: 'Bree Serif', serif; }
display: flex;
/* Services Section */
font-family: 'Baloo Bhai', cursive;
#services {
}
margin: 50px;
#navbar ul li {
display: flex; }
list-style: none;
#services .box {
font-size: 1.3rem;
border: 2px solid brown;
}
padding: 34px;
#navbar ul li a {
margin: 2px 27px;
text-decoration: none;
border-radius: 28px;
color: white;
background: #f2f2f2;
padding: 3px 22px;
margin-bottom: 20px; }
}
73 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
#services .box img { align-items: center;
display: block; padding-bottom: 34px;
height: 160px; }
margin: auto; #contact-box input,
} #contact-box textarea {
#services .box p { width: 100%;
font-family: 'Bree Serif', serif; padding: 0.5rem;
} border-radius: 9px;
/* Clients Section */ font-size: 1.1rem;
#client-section { }
position: relative; #contact-box form {
} width: 40%;
#client-section::before { }
content: ""; #contact-box label {
position: absolute; font-size: 1.3rem;
background: url('../[Link]'); font-family: 'Bree Serif', serif;
width: 100%; }
height: 100%; footer {
z-index: -1; background: black;
opacity: 0.3; color: white;
} padding: 9px 20px;
#clients { }
display: flex; /* Utility Classes */
justify-content: center; .h-primary {
align-items: center; font-family: 'Bree Serif', serif;
} font-size: 3.8rem;
.client-item { padding: 12px;
padding: 34px; }
} .h-secondary {
#clients img { font-family: 'Bree Serif', serif;
height: 124px; font-size: 2.3rem;
} padding: 12px;
/* Contact Section */ }
#contact { .btn {
position: relative; padding: 6px 20px;
} border: 2px solid white;
#contact::before { background-color: brown;
content: ""; color: white;
position: absolute; margin: 17px;
width: 100%; font-size: 1.5rem;
height: 100%; border-radius: 10px;
z-index: -1; cursor: pointer;
opacity: 0.7; }
background: url('../[Link]') no-repeat center .center {text-align: center;}
center/cover;
}
#contact-box {
display: flex;
justify-content: center;
74 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
CSS Programming ([Link])
/* Navigation */
#navbar {flex-direction: column;}
#navbar ul li a{
font-size: 1rem;
padding: 0px 7px;
padding-bottom: 8px;
}
/* Home section */
#home{
height: 370px;
padding: 3px 28px;
}
#home::before{height: 480px; }
#home p{font-size: 13px;}
/* Services section */
#services{flex-direction: column; }
#services .box {
padding: 14px;
margin: 2px 0px;
margin-bottom: 20px;
}
/* Clients section */
#clients{
flex-wrap: wrap;
}
#clients img{
width: 66px;
padding: 6px;
height: auto;
}
/* Contact us section */
#contact-box form{
width:80%;
}
/* Utility classes */
.h-primary{font-size:26px;}
.btn{
font-size: 13px;
padding: 4px 8px;
border-radius: 3px;
}
75 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Introduction to Bootstrap
Bootstrap is a free, open-source front-end framework used for designing responsive and mobile-friendly
websites. Developed by Twitter, it includes HTML, CSS, and JavaScript components that make web
development faster and easier. Bootstrap provides a grid system, pre-styled components (like buttons, forms,
and navigation bars), and JavaScript plugins to help developers create professional-looking websites without
writing extensive code.
Advantages of Bootstrap
1. Easy to Use – Requires basic knowledge of HTML and CSS.
2. Responsive Design – Automatically adjusts layouts for different screen sizes.
3. Grid System – A flexible grid layout for structuring web pages.
4. Pre-styled Components – Includes buttons, modals, forms, alerts, and more.
5. Browser Compatibility – Works on all major browsers (Chrome, Firefox, Safari, etc.).
6. Customizable – Modify styles using CSS or Bootstrap’s built-in SASS variables.
7. Faster Development – Reduces coding time with reusable components.
8. Strong Community Support – Many developers contribute to Bootstrap, ensuring updates and bug
fixes.
Bootstrap 12 Column Layout System
Bootstrap uses a 12-column grid system to help developers create responsive layouts easily. This system
allows you to divide a webpage into 12 equal parts (columns) that can be combined in different ways to
structure your content.
Key Concepts
1. .container: The outermost element that holds the grid.
• .container (fixed width)
• .container-fluid (full width)
2. Row: The row (.row) is used to create a horizontal group of columns.
3. Columns: The layout is built using columns (.col-*) inside rows. The sum of columns in a row should
not exceed 12.
4. Breakpoints: Bootstrap has responsive classes to control layouts at different screen sizes:
• col-sm-* (Small) → ≥576px
• col-md-* (Medium) → ≥768px
• col-lg-* (Large) → ≥992px
• col-xl-* (Extra Large) → ≥1200px
76 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Exercise-1
<div class= “container”>
<div class="row">
<div class="col-xl-6 col-sm-12">50% desktop, 100% mobile</div>
<div class="col-xl-6 col-sm-12">50% desktop, 100% mobile</div>
</div>
</div>
Exercise-2
<div class= “container-fluid”>
<div class="row">
<div class="col-lg-6 col-sm-12 col-10">Column 1</div>
<div class="col-lg-3 col-sm-6 col-10">Column 2</div>
<div class="col-lg-3 col-sm-6 col-10">Column 3</div>
</div>
</div>
Exercise-4
<div class="row">
<div class="col-xxl-1 col-xl-2 col-lg-4 col-md-6 col-sm-12">Column 1</div>
<div class="col-xxl-11 col-xl-10 col-lg-8 col-md-6 col-sm-12">Column 2</div>
</div>
77 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Introduction to JavaScript
JavaScript (JS) is a powerful, lightweight programming language used to make web pages interactive and
dynamic. It runs in web browsers and enables features like animations, form validation, dropdown menus, and
real-time updates without refreshing the page.
JavaScript is one of the core technologies of web development, along with HTML (for structure) and CSS (for
styling).
Advantages of JavaScript in Web Development
1. Interactivity: Enables dynamic content, such as pop-ups, sliders, and real-time data updates.
2. Fast Performance: Runs directly in the browser without needing a server.
3. Easy to Learn: Has a simple syntax similar to English.
4. Wide Browser Support: Works on all major browsers (Chrome, Firefox, Edge, Safari, etc.).
5. Reduces Server Load: Many tasks can be handled on the client side, improving website speed.
6. Versatile: Can be used for front-end (UI) and back-end (server-side with [Link]).
7. Large Community: Many libraries, frameworks, and resources are available (React, Angular, Vue).
8. Enhances User Experience: Improves usability with features like auto-complete and smooth
scrolling.
Basic Example: ([Link])
<body>
<button onclick="showMessage()">Click Me</button>
<script>
function showMessage() {
alert("Hello! This is JavaScript in action.");
}
</script>
</body>
78 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Alternatives to alert ()
1. confirm ( ): Asks for user confirmation (OK/Cancel)
Example
if (confirm("Are you sure?")) {
alert("You clicked OK!");
} else {
alert("You clicked Cancel!");
}
2. prompt ( ): Allows user input in an alert-like box.
Example
if (confirm("Are you sure?")) {
alert("You clicked OK!");
} else {
alert("You clicked Cancel!");
}
Data Types
There are three main data types in JavaScript.
5. Number: Represents both integers and floating-point numbers.
6. String: Represents a sequence of characters. Can be written in single ('), double (") or template
literals (`).
7. Boolean: Represents true or false.
Example: (Number) Example: (String) Example: (Boolean) Check Data Type
let age = 25; let name = "Ali"; typeof(25);
let isOnline = true; typeof(“ali”);
let price = 99.99; let greeting = 'Hello';
let isRaining = false; typeof(true);
let negative = -10; let message = `Welcome, ${name}!`;
JavaScript Variable
A variable in JavaScript is a container that stores data. It allows us to store values and reuse them throughout
our program. Variables make code more flexible and dynamic.
Declaring Variables in JavaScript
JavaScript provides three ways to declare variables:
1. var (old, function-scoped, avoid using)
2. let (modern, block-scoped, recommended)
3. const (constant, block-scoped, cannot be reassigned)
Syntax:
let variableName = value;
Example-1 Example-2 Example-3
79 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Example-4 Example-5
let gameLevel=1;
let num1=50;
gameLevel=2;
let num2=50;
gameLevel=3;
let total=num1+num2;
alert("Your Current Game Level is: " + gameLevel);
alert("Total Num1 and Num2 is:" + total);
Using Variables for User Login
let username = "Ali";
let isLoggedIn = true;
if (isLoggedIn) {
[Link]("Welcome, " + username + "!");
} else {
[Link]("Please log in.");
}
String Lengths & Retrieving the Number of Characters
String Length (Example) Tweet Length (Example)
let tweet=prompt("Compose your tweet:");
var myName="Ali"; let tweetCount=[Link];
[Link]; alert("You have written " + tweetCount + " Characters, you have " +
(140-tweetCount) + " Characters remaining.");
80 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Project: Interactive Button That Changes Background Color
This example demonstrates how JavaScript works with HTML and CSS to make a webpage dynamic.
HTML Programming ([Link])
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JavaScript with HTML & CSS</title>
<link rel="stylesheet" href="[Link]">
</head>
<body>
<h1>Click the Button to Change Background Color</h1>
<button onclick="changeColor()">Change Color</button>
<script src="[Link]"></script>
</body>
</html>
[Link] (Programming) [Link] (Programming)
body { function changeColor() {
text-align: center; // Array of colors
font-family: Arial, sans-serif; const colors = ["#FF5733", "#33FF57", "#3357FF", "#FF33A1",
padding: 50px; "#F4D03F"];
transition: background-color 0.5s;
} // Select a random color
button { const randomColor = colors[[Link]([Link]() * [Link])];
font-size: 16px;
padding: 10px 20px; // Change background color
cursor: pointer; [Link] = randomColor;
background-color: #3498db; }
color: white;
How It Works
border: none;
border-radius: 5px; 1. HTML – Creates the button and heading.
transition: 0.3s; 2. CSS – Styles the button and applies smooth transitions.
} 3. JavaScript – Adds functionality so that clicking the button changes
button:hover { the background color randomly.
background-color: #2980b9;
}
81 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
82 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Network & Internet
Network:- A computer network is a group of computers which are connected together to allow
communication between them.”
TYPE OF NETWORK
1) LAN (Local Area Network)
2) MAN (Metropolitan Area Network)
3) WAN (Wide Area Network)
LAN (Local Area Network): Network in a limited geographical area like a single room or in a single
building.
MAN (Metropolitan Area Network): Network within a city.
WAN (Wide Area Network): Network within a country or between multiple countries.
83 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
INTERNET
Difinition:- Internet stands for (International Network). It is a global “Network of Networks”. The internet
is a worldwide public network of computers on which people can join and use multiple services such as
sharing of information.
By internet users at any one computer can get information from any other computer.
It was developed by the United States Defense Advanced Research Project Agency in 1970s and was initially known as
“ARPANET” (Advanced Research Project Agency Network)
The Internet was designed to be used by companies and Universities doing military research so that
they could share information. Since then the number of people who use the Internet and the services that are
provided on the Internet have grown tremendously. There are now over millions of people who regularly make use of
it.
Advantages of Internet
There are many advantages to using the internet such as:
➢ Email
➢ Sharing Information..
➢ Services.
84 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
➢ Buy or sell products.
➢ Communications.
➢ News
➢ Searching Jobs
➢ Advertisements.
➢ Entertainment.
➢ Online Education facility
Disadvantages of Internet
Although there are huge advantages of internet but there is always another side of picture.
So Internet has some disadvantages like
Viruses
Security Problems
Immorality
Many information is not accurate
Wastage of Time
HTTP:-It stands for Hypertext Transfer Protocol. This protocol used for a web document (HTML).
Home Page:-The first page which appears when we open the web browser or any web site.
ISP:-It stands for Internet service provider. ISP provides the internet services.
Web Browser:-It is the special software, in which we can open the web pages and those web pages are
designed in special language called HTML (Hyper Text Transfer Protocol).
URL:-It stands for Uniform Resource Locator. Some time we refer web site as URL.
Modem:- It stands for Modulator and Demodulator. Modulator converts digital signal into analog. And
Demodulator converts analog signals into digital signals. It is card that we need when we use Internet
through telephone lines.
LAN Card:-It is also called NIC or Network Interface Card. This card is used in network. If we want to
connect two computers, so for connecting those two computers with one another, we need a card that is
called LAN Card.
Router:-It is a device, which is used to connect the different types of network. It is also uses in internet.
85 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
TCP/IP:-It stands for Transmission Control Protocol. Any computer which wants to communicate in Internet
it must have the TCP/IP protocol. TCP/IP is responsible for sending message from sender to receiver or from
source to destination. It also breaks the message into smaller packets. It is also responsible for routing.
E-Mail Protocols:
There are basic E-Mail protocols, which are SMTP and POP. SMTP stands for Simple Mail Transfer Protocol
and it is responsible for sending an e-mail. POP stands for Post Office Protocols. It is responsible for
receiving an e-mail.
FTP:-It stands for File Transfer Protocols. For upload and downloading files to or from internet we need
these protocols.
E-Mail Services
[Link]
[Link]
[Link]
Search Engines:
86 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Windows 7 Installation Step by Step
In order to install your copy of the Windows 7 operating system please make sure
to have the following items:
-Windows 7 Installation disk
-Drivers CD: * Use after installation process if needed.
* NOTE: Please make sure to back up all of your important data before proceeding with this
installation.
Step 1. Insert the Windows 7 operating system disk into your DVD drive, and then restart your
computer
Step 2. You will see a prompt that says “Press any key to continue” after the ZT logo
disappears. When
you see this press any key immediately.
* NOTE: The following screen shots may differ from what you may see during your installation.
(i.e. Win7
version, HDD disk space etc..)
87 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Windows 7 Installation Step by Step
Step 4. Language options, by default English will be set along with “time and currency format” and
“keyboard or input method”
88 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Windows 7 Installation Step by Step
Step 6. End User License Agreement (E.U.L.A.), check the box to accept, and click “Next”
Step 7. “Which type of installation?” window will appear. Upgrade will be greyed out; the only
option you should be able to choose is Custom (advanced).
89 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Windows 7 Installation Step by Step
Step 8. “Where do you want to install windows?” Make sure the partition is highlighted.
Step 9. Delete the partition by clicking on Drive options (advanced) on the bottom right corner of
the field.
Make sure the partition is highlighted and click on Delete. If drive advanced options is greyed out,
then the partition will not have to be deleted.
NOTE: Deleting the partitions will erase all data on the system.
Step 10. Disk 0 Unallocated Space should be the only listing at this point. If it is press next, If not
please proceed to delete any additional partitions that may be listed.
90 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Windows 7 Installation Step by Step
Step 11. The next screen will show “Installing Windows”. This process should take approximately
10 minutes
after which the system will reboot
*NOTE: Do not press any keys during this boot up process so as to not disturb the rest of the
installation.
Step 12. The next screen will show “Installing Windows” again to complete the installation process.
Step 13. “Setup is starting Windows” will appear on the screen, then you will be asked to create a
user name and a computer name.
91 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Windows 7 Installation Step by Step
Step 14. The next step will prompt you to create a password for your account (optional).
Step 15. The next screen will come up and ask you to choose one of three options: “Use
recommended settings”, “Install important updates only” and “Ask me later”.
92 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Windows 7 Installation Step by Step
Step 16. This screen will allow you to choose your local time zone and also adjust the date and
time.
Step 17. Click on the appropriate location of your computer to enable Windows 7 to apply the
correct network settings.
93 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606
DAWN INSTITUTE OF INFORMATION TECHNOLOGY SARHAD
Windows 7 Installation Step by Step
The installation is done! You have successfully installed Windows 7 on your ZT computer.
94 Address: Memon Market Main Road Umer Daho Sarhad Ph. 0723-654106, 0301-2833606