Cs Finals
Cs Finals
io/CS3/
1.0
INTERNET
- The network where computers and other devices (ie local area netowrk/LAN, wide area
network/WAN) are connected to each other
3. Web Services
- Covers the use of applications that make access to the internet easier
- Ex, mobile apps and cloud computing services
-
● client
- The computer/person trying to access the Internet
- Requests data from the server via a protocol (HTTP)
● Hypertext Transfer Protocol (HTTP)
- protocol that makes use of request-response system
- An HTTP request sent by the client consists of diff info ie the (uniform resource
locator) URL of the requested data
- An HTTP response is sent by the server to the client also holds diff info ie the
status of the connection and the data requested by the client
● server
- A software/ cloud computer that processes the client req and returns the req
data
- If the requested data is unavailable, it requests data from other servers where it
temporarily becomes a client itself
-
- Example: https://garfield.fandom.com/wiki/Garfield.com
WEB DEVELOPMENT
- The creation of web pages and other services accessible online
3 parts:
● Client-side Web Development
- the creation of front-end applications.
- Deals mainly w user interface and applications that interact w the user
● Server-side Web Development
- involves the heavy programming of applications that the user does not see.
- Example is maintenance of cloud storage, email services, etc.
● Database Management
- deals with the maintenance of data online
- also includes creation of effective and fast ways of accessing data
BROWSERS
- A software program that allows users to receive and send data from the Internet
> This data is presented via websites w multiple webpages and can be in the form of
text, pictures, video, and audio
- Allow the user to view data in the intended format
- Allow user to navigate the Internet, going from one website to another
- They do the communication over the internet
2.0
<head> element
- contains meta information about the HTML page.
- Everything in it will not be displayed in the main body of the webpage.
<title> element
- specifies a title for the HTML page, shown in the browser's title bar or the page's tab.
<meta> tags
- contain information related to the HTML document, such as character encoding, author
information, and keywords.
- Its important to include proper meta tags in all submissions.
<link> element
- used to connect the current HTML file to an external source.
- For example, it can define an icon for the webpage on the browser tab. Later, the
`<link>` element will be used to link to other types of files.
<body> element
- defines the document's body, serving as a container for all visible content like headings,
paragraphs, images, hyperlinks, tables, lists, etc.
<!-- -->
- comment tag
- will not be displayed in the browser.
2.2
- Every HTML element has a default display value based on its type. The two main display
values are block and inline:
● Block Elements
- take up the full width available, causing any subsequent HTML elements to start
on the next line.
● Inline Elements
- only take up the width of their content, allowing the next HTML element to be
placed immediately beside them.
NOTE: The width of inline elements cannot typically be changed, with a few exceptions.
Common HTML Elements and Their Default Display Values
● <div> Element
- Used to contain other HTML elements or to define sections of a webpage.
- Block element
- Can contain text or group together other HTML elements.
● <span> Element
- Used to contain other HTML elements or define sections within a document.
- Inline element
- Can contain text or group together other HTML elements.
● HTML Lists
- There are two types of lists in HTML:
● Ordered <ol> w numerical values
● Unordered <ul> w bullet points
- Block elements
- - Use the <li>`tag to define each item within the list. Ensure proper indentation to
show that the <li> elements are nested inside the list tag (e.g., `<ol>` or `<ul>`).
2.3-2.4
➢ <p> Element
➢ - Used to add paragraphs of text in HTML code.
➢ - It is a block element.
➢ - Enclose all contents of the `<p>` element with a closing `</p>` tag.
<a href="url">
<img src="icon.jpg" alt="Click here!">
</a>
- Links can also point to another section of the same page using anchor tags, like "Back to Top"
links.
```html
<a href="#top">Back to top</a>
```
table
- used to organize information.
- were used to format web page layouts before browsers supported CSS.
NOTE:
● An HTML table is composed of rows and columns, like a spreadsheet.
● Each individual table cell is at the intersection of a specific row and column.
Cell borders
To add a border to your table, style the individual cells (`<td>`). You must specify the style of the
border (e.g. solid or dotted line), its width, and its color. A solid line, 1 px wide, is commonly
used.
Table Heading
- `<th>` tag. This tag replaces the `<td>` tag, which is used to represent a data cell.
- the top row is used for table headings, but the `<th>` element can be used in any row
- centered by default.
3.2
Example: A table with a spanning row heading cell may have a row where a single cell spans
both heading cells in the next row.
Rowspans
- add complexity. When you insert a row-spanning cell, you create a new column, and
must add corresponding cells to every other row, except for the row containing the
spanning cell.
-Care is needed when defining tables with multiple spanning rows and columns. Ensure that
columns are counted correctly and the cells align with their corresponding spanning cells.
In HTML5, the `cellpadding` attribute is no longer supported. Instead, use the CSS `padding`
property within the `style` attribute to set the padding inside table cells.
- Example for 10px of cellpadding using CSS:
<td style="padding:10px;"></td>
Cellspacing
- Adjusts the space between the borders of adjacent table cells.
- Use the CSS `border-spacing` property for this, but it works only if the `border-collapse`
property is set to `separate`.
- Example for 10px of cellspacing:
<table style="border-spacing:10px; border-collapse:separate;"></table>
4.1
Color
- a powerful tool in web design and development. It can be used to:
1. attract attention
2. express meaning
3. convey a message
4. group elements with common themes
5. create desire
6. set the mood and feel
7. earn audience loyalty
NOTE: Good color choices require careful planning and, when done correctly, can influence
how an audience interprets what they see, as much as content and layout.
3. target audience
Consider your target audience's gender, age, cultural background, and preferences. Studies
have shown that women’s top color preferences are blue, purple, and green, while men favor
blue, green, red, and black. Both genders like blue, but they differ significantly on purple.
4. color palette
A good website color palette follows the 60/30/10 rule. Use one color for 60% of the site, a
secondary color for 30%, and an accent color for the final 10%. The accent color contrasts with
the other two and highlights important content.
4.2
WIREFRAME
- One of the tools that could be used to assist a web or app developer to design and
layout a website or an app
- important because it can be used to show a web site/app on its structural level,
present its content and its functionality.
- used in the development process that takes into consideration a particular
group of users’ needs.
‘
WIREFRAM PURPOSES:
A wireframe needs to include important elements commonly seen in most websites and apps.
These elements are:
● Logo
● Search field
● Breadcrumb
● Headers, including page title as H1 and subheads H2-Hx
● Navigation systems, including global and local navigation
● Body content
● Share buttons
● Contact information
● Footer
High-fidelity wireframes
5.0
CSS
- allows you to control the layout and design of an HTML document
- can change the color of the text, font style and other design and layout.
- Would require a styling rule which will be interpreted by the browser
CSS Structure
● selector
- specifies which html element should be styled.
- After it is an open and close curly braces.
- Inside it is the CSS declaration.
> The CSS declaration block may contain one or more CSS declarations
and has two parts – the property and the value.
● property name
- a keyword that is already predefined by the CSS specification.
NOTE: In each property, there is a set of predefined values which are separated by a colon
and terminated by a semicolon. Semicolon is used to separate two declarations
Selectors
- Helps in styling html elements
Element Selector
- selects elements based on its name.
- For example, p of the paragraph tag.
Universal Selector
- it selects all the elements of your HTML page.
- denoted using the symbol '*'.
Id Selector
- will use the id attribute of an HTML element to select a specific element. A page has a
unique id for an element, thus, it will only select one unique element.
- (#) character is used followed by the elements id
Class Selector
- selects the HTML element with a specific class attribute
- is implemented with the help of the symbol period (.), followed by the class name.
Grouping Selector
- Elements that apply the same style rule can be grouped together.
Descendant Selectors
- applies style rules to a particular element only if it lies inside a particular element
> the rule is applied to a <p> element only if it lies inside a div element with a
class="center".
Child Selectors
- is applied only to a direct child of an element.
- For example, the <p> element that is a direct child of the body will apply the style rule
below.
- other <p> element which is inside a <div> or other elements will not apply the rule.
- character '>' is used to apply the rule in a child selector.
5.2
TYPES OF CSS
• Inline • Internal or Embedded
Inline CSS
- incorporated as value of the style attribute of an HTML element.
- used to apply a unique style on an element
Internal or Embedded CSS
- is used when an HTML page will have a unique style.
NOTE: The CSS properties are defined inside the <style></style> tag in the head section of an
HTML document.
External Stylesheet
- used to have a single uniform style applied on every web page of a website that uses it
NOTE: The CSS properties are saved in a separate text file w an extension of .css and is
referenced from an HTML doc using the <link> tag inside the head selection
<link> format
rel="stylesheet"
- means what will be relationship of the file href="mystyle.css" to the HTML document.
NOTE:
the values for href could be a path\filename or a URL that points to an online .css document.
The .css file DOES NOT need the <style></style> tag inside it
The output would be the same as the Internal CSS.
CSS Colors
- Can be specified using its predefined color names, or RGB, HEX, HSL, RGBA, HSLA
values. The predefined color names are simply the name of the colors that we know.
RGB Value
- formula is rgb(red, green, blue). The parameter – red, green and blue has values from 0
to 255 which defines the intensity of the color. For example, rgb(0,0,255) is displayed as
blue since blue is set to the value 255 while others are set to 0.
HEX Value
- format `#RRGGBB`.
- `RR` (red), `GG` (green), and `BB` (blue) are hexadecimal values from `00` to `ff`.
- Example: Red is `#ff0000`, where red (`RR`) is at maximum (`ff`), and green and blue are set
to `00`.
HSL Value
- color definition using hue, saturation and lightness in the format `hsl(hue, saturation,
lightness)`.
● Hue- is a degree from `0` to `360` on the color wheel.
● Saturation- a percentage where `0%` is gray and `100%` is full color.
● Lightness- a percentage where `0%` is black and `100%` is white.
5.5
CSS Padding
- Padding is the space between the content of an element and its border.
- The `padding` property controls the amount of space in this area.
- Similar to the `margin` shorthand property, padding can also be set individually:
● - `padding-top`: Defines the top padding.
● - `padding-right`: Defines the right padding.
● -`padding-bottom`: Defines the bottom padding.
● - `padding-left`: Defines the left padding.
Box Sizing
- When specifying width, it sets the width of the content by default, not the entire box.
- Example: If a `<div>` has a width of 430px and box-sizing is set to content-box, the total width
includes padding and borders:
- Total width = content width + left border + right border + left padding + right padding.
- If box-sizing is set to border-box, the total width is equal to the defined width, including padding
and borders.
- To apply the box-sizing property to all HTML elements, use the universal selector:
```
*{
box-sizing: border-box;
}
Containing Blocks
- The CSS2.1 specification defines a "containing block" as the rectangle relative to which an
element is positioned.
- Key rules for determining the containing block:
● - If an element is not within another positioned element, it will position relative to the
initial containing block.
● - If an ancestor has its position set to `relative`, `absolute`, or `fixed`, the child element
will be positioned relative to that ancestor's edges.
● - Offset values apply to the outer edges of the element box (from margin edge to
margin edge).
- Absolutely positioned elements behave as block-level elements:
● - Margins on all sides are maintained.
● - A width can be set for the element.
Positioning
- Once positioned, an element becomes the new containing block for its child elements.
Specifying Position
Pixel Measurement
- Positive offset values push the element away from the specified edge toward the center of the
containing block.
- If no value is provided for a side, it defaults to `auto`, and the browser adds space to adjust the
layout.
Percentage Values
- Positions can also be specified using percentages:
- For example, an image positioned halfway down the left edge of the containing block.
- Another example would be positioning an element in the bottom-right corner of the containing
block.