HTML basics
HTML Introduction
- HTML uses tags to structure content and create elements
- Elements are defined by opening and closing tags, and can have attributes
- The structure of an HTML document consists of the
<!DOCTYPE>
declaration, the <html>
element, the <head>
element, and the <body>
element
HTML links
Creating Hyperlinks
- Hyperlinks are created using the
<a>
element with an href
attribute
- Links can have different states that can be styled with CSS
- Links can also point to specific locations within a page using anchor tags and IDs
CSS normal flow
Normal Flow
- Normal flow is the default layout behavior of elements on a web page
- Elements are laid out in the order they appear in the HTML document
- Elements can be styled using CSS properties such as
width
, height
, and margin
CSS positioning
Positioning
- Positioning allows elements to be placed in a specific location on a web page
- Elements can be positioned using properties such as
position
, top
, bottom
, left
, and right
- Different types of positioning include static, relative, absolute, and fixed
JavaScript basics
JavaScript
- JavaScript is a programming language used to add interactivity to web pages
- JavaScript code is executed by web browsers
- JavaScript can manipulate HTML and CSS, handle events, and perform calculations
JavaScript functions
Functions
- Functions are reusable blocks of code that perform a specific task
- Functions can take arguments and return values
- Functions can be defined using function declarations, function expressions, and arrow functions
Pair programming
Pair Programming
- Pair programming is a practice where two programmers work together on the same task
- Benefits of pair programming include improved code quality, increased learning, and better collaboration
- Pair programming can be done in different styles, such as driver-navigator and ping-pong
#1: To create a basic link, we wrap text or other content inside what element?
The <a>
element.
The destination URL that the link should go to.
#3: What are some ways we can ensure links on our pages are accessible to all readers?
Using descriptive link text, ensuring the link is keyboard accessible, and using appropriate link contrast.
#4: What is meant by “normal flow”?
Normal flow is the default layout behavior of elements on a web page, where elements are laid out in the order they appear in the HTML document.
#5: What are a few differences between block-level and inline elements?
Block-level elements take up the full width of their container, while inline elements only take up as much width as their content. Block-level elements start on a new line, while inline elements do not.
#6: ___ positioning is the default for every HTML element.
Static positioning.
#7: Name a few advantages to using absolute positioning on an element.
Absolute positioning allows elements to be placed precisely on the page, it can be used to create complex layouts, and it can be used to layer elements on top of each other.
#8: What is a key difference between fixed positioning and absolute positioning?
Fixed positioning is relative to the viewport, while absolute positioning is relative to the nearest positioned ancestor.
#9: Describe the difference between a function declaration and a function invocation.
A function declaration is the creation of a function, while a function invocation is the actual execution of a function.
#10: What is the difference between a parameter and an argument?
A parameter is a variable listed in the function definition, while an argument is the actual value passed to the function when it is called.
#11: Pick 2 benefits to pair programming and reflect on how these benefits could help you on your coding journey.
Pair programming can enhance code quality and learning by enabling mistake identification and facilitating collaboration and discussion.