HTML/CSS Flashcards
(70 cards)
What is Semantic HTML?
Semantic HTML is the use of HTML tags that provide a clear purpose of the content’s role within a webpage.
They make your website code more understandable for both developers and search engines.
For example, <header>is a semantic HTML tag. It encloses the header section (introductory content) at the top of the page.
Examples:
<h1></h1>
<nav></nav>
<ul></ul>
<footer></footer>
What is Non-Semantic HTML?
Non-semantic HTML tags are generic and primarily used for styling and layout purposes.
Non-semantic HTML tags don’t convey any specific meaning about the content itself.
Examples:
<div></div>
<span></span>
<a></a>
Explain how HTML, CSS, and JavaScript work together?
- he browser starts by reading and parsing the HTML from top-to-bottom to create the DOM tree (It is a representation of the HTML content structure where each element is a node in the DOM tree. Each element, attribute, and text becomes an object in the DOM tree that can be accessed and manipulated by JavaScript later on.)
- Then it reads/parses the CSS file and constructs a CSSOM (CSS Object Model), it organizes it into a hierarchical structure.
- The DOM and the CSSOM are merged into a Render Tree, which contains only visible elements with their applied styles.
- Then the browser determines the exact position of each visible element based on the Render Tree and paints it on the browser screen pixel by pixel.
- Lastly, JavaScript is parsed and executed separately through the
. JavaScript can modify the DOM, change CSS, and fetch new content dynamically. When this happens, the browser may need to recalculate the layout and repaint parts of the screen.
What is HTTP? What are other HTTP types that are out there?
What is HTTP?
HTTP (Hypertext Transfer Protocol) is a form of data communication between the web browsers and servers. It is built off of TCP/IP on the application-layer protocol. It transports web pages, media, and other resources.
Model type:
HTTP operates on a request-response model: the client sends requests to servers, which then responds with the requested data. The protocol is stateless, meaning each request is independent of any previous requests.
Method Types:
HTTP supports different types of methods to interact with resources: (GET, POST, PUT, DELETE, etc.)
Security:
HTTPS uses encryption to protect data in transit.
What are the ways to add images to html? Be specific!
Example: Explaining how to add to the src attribute.
- <img></img> element
- <Picture> element for responsive design
</Picture> - CSS background-image on an element
- Inline SVG: embed SVG into HTML
- <object> for svg or external files
</object> - <embed></embed>for embedding svg’s
- <iframe> Embedding images for another site.
</iframe> - Data URL (base64-encoded image)
What are HTML attributes? Can you give an example?
The information inside an html element defining rules for it.
Example,
href=””,
src=””,
style=””,
type=””,
etc
What is the difference between <div> and <span>?</span>
<div> is a block-level element for grouping and structuring larger sections of a webpage.
<span> is an inline element for styling or manipulating a small portion of text within a larger block of content.
</span></div>
What is the purpose of the <head> tag in HTML?
To provide meta data and background information for the HTML file.
What is block-level and inline in HTML? What are some common block-level and inline elements in HTML?
A block-level takes up a full width of its parent container by default. It starts a new line and pushes the next elements down.
An Inline element only takes up as much width as necessary. It does not start a new line. It stays within flow of the surrounding text.
What is the difference between <strong> and <b>, <em> and <i>?</i></em></b></strong>
The difference between the two is that <strong> is a semantic element for search engines. Whereas <b> is just a regular, non-semantic element. They both embolden the text.</b></strong>
The same with <em> and <i> with italicizing the text. <em> which stands for emphasis, is a semantic element whereas <i> is not.</i></em></i></em>
If you have a nested div within a div and they both have an id or class, how do you change the inner div?
With CSS selectors. You would tag the inner div with its id name, since it is unique. The parent div could have the same class. With that id name selected, you can change the inner div.
What is CSS and why is it used?
CSS (Cascading Style Sheets) is a stylesheet language used for describing the presentation of a web page written in HTML or XML.
CSS is used to enhance the visual appearance and user experience of web pages through responsive design, layout, colors, fonts, etc.
What are the different types of CSS? (Inline, Internal, External)
Inline: Is CSS written within the individual elements <> in the HTML file
Internal: Is writing it in the head of the HTML structure
External: Is linking an external CSS file to the HTML file to style it.
What is the difference between id and class in CSS?
An id is unique per HTML document file and is used to identify a single element.
A class is used to identify multiple elements with the same class. Is used to apply the same styling or behavior to multiple elements.
What’s the difference between relative, absolute, fixed, and sticky positioning?
How does the float property work?
What does the z-index property do in CSS?
How does the Internet work?
The Internet works through a global network of interconnected computers and servers, communicating via standardized protocols. Data is broken into packets and routed through various network nodes using the Internet Protocol (IP). These packets travel across different physical infrastructures, including fiber optic cables, satellites, and wireless networks.
What is Domain Name System (DNS)?
DNS is crucial for the functioning of the Internet, enabling users to access websites and services using memorable names instead of numerical IP addresses.
The system uses a tree-like structure with root servers at the top, followed by top-level domain servers (.com, .org, etc.), second-level domain (usually the website or organization name), and local DNS servers.
What is the Box Model?
The fundamental concept that describes how elements are rendered on a webpage. Every HTML element is treated as a rectangular box, and the box model defines how the size of this box is calculated, including content, padding, border, and margin.
What is HTML?
HTML stands for HyperText Markup Language. It structures web content and allows the inclusion of text, images, links, and other elements on the screen.
What are HTML tags?
HTML tags are the building blocks of HTML. They are used to create elements and structure content on a web page. Tags are enclosed in angle brackets, For example, <p> for a paragraph. Most tags come in pairs: an opening tag <p> and a closing tag </p>.
What is the basic structure of an HTML document?
<!DOCTYPE html>: Declares the document type and version of HTML.
<html>: The root element of the document.
<head>:Contains meta-information about the document, such as the title and links to stylesheets.
<title>: Specifies the title of the document, displayed in the browser’s title bar.
<body>:Contains the content of the document, such as text, images, and other elements.
</body></title></head></html>
What is the purpose of a DOCTYPE declaration in HTML5?
The DOCTYPE declaration in HTML5 is used to specify the document type and version of HTML that the web page is written in.
This is a paragraph.
is a paragraph element., and
to .
- Inline elements: These elements do not start on a new line and only take up as much width as necessary. Examples include ,, and
.
- tag.
- Unordered List: Creates a bulleted list using the
- tag.
tag?
tag: inserts a line break in the text, moving the content after the tag to a new line. It’s an empty tag and doesn’t require a closing tag.
- (ordered list) tag, with each list item defined by
- :
- First item
- Second item
- Third item
- tag for the list,
- for each term, and
- for each definition:
- HTML
- HyperText Markup Language
- CSS
- Cascading Style Sheets
Visit us at:
Example.com
Box 564, Disneyland
USA