2016 Final Exam Flashcards
b) Write HTML code that inserts an image as a link in a page, meaning that clicking on the image takes the user to http://www.someplace.com.
a href=”http://www.someplace.com”>
<img></img>
</a>
c) What is the normal flow of the Block-level elements? [2 marks]
boxes are laid out vertically one after the
other, beginning at the top of the containing block.
d) Write a style rule for a <p> element that sets the margins to 2em, padding to 1em, and a black, solid 1px border.
p {
margin: 2em;
padding : 1em;
border: 1px solid black;
}
a) Name and describe any four HTML 5 elements used for content sectioning.
<aside> his element represents
content that is indirectly related to the main content.
<section> his is a generic container for grouping related content.
<nav>This element designates a section containing navigation links
<article>This element defines a
self-contained piece of content.
<main>his element represents the
main content of the webpage.
</main></article></nav></section></aside>
b) Explain the different parts of the CSS Box Model: [8 marks]
Content: This is the core area where the actual content of the element resides, like text in a paragraph or an image.
Padding: This is the space around the content that creates a buffer between it and the border. Padding does not affect the overall width or height of the element.
Border: This is the visual outline around the element, defined by properties like width, style (solid, dashed, etc.), and color. Borders add to the overall dimensions of the element.
Margin: This is the outer area surrounding the element, including padding and border. It creates separation between the element and other elements on the page. Margins also add to the total size occupied by the element.
c) Which attribute is used for the vertical alignment of cell content? [2 mark]
vertical-align
a) Write an HTML snippet that links a document to a CSS file named style.css. [3 marks]
<link></link>
b) With a code example, describe how inline CSS could be used to format the appearance of an element in an HTML document.
<h1>Welcome</h1>
c) Describe what a “web browser” is and name any browser that you know of. [3 marks]
A web browser is a software application that allows users to access and interact with websites on the internet. Some common web browsers include Chrome, Firefox, Safari, and Edge.
d) What is the difference between the GET and the POST methods in HTML? [4 marks]
GET: Retrieves data from a server.requests can be bookmarked and cached by browsers.Appends data to the URL (visible in address bar). Limited data size due to URL length restrictions.
POST: Submits data to a server.Requests cannot be bookmarked and are not typically cached.ends data in the HTTP request body (not visible in address bar). No data size limitations.
g) What is the function of the new HTML 5 <canvas> element? [3 marks]</canvas>
creates a bitmap (rectangular area of pixels) on the web page. JavaScript is then used to manipulate this area, allowing for the dynamic rendering of graphics, animations, and games directly within the browser.
d) One key issue that affect website design is Accessibility. Explain what Accessibility is.
Website accessibility ensures that everyone, regardless of ability, can perceive, understand, navigate, and interact with a website.
e) Which type of image format supports transparency and interlacing but not animations?
[2 marks]
PNG (Portable Network Graphics)
.
f) Identify the various parts of this style rule: [4 marks]
blockquote{
line-height: 1.5;
}
selector = blockquote
declaration = line-height : 1.5;
b) What is the difference between inline and block elements? Give 2 examples of each? [6 marks]
inline elements flow within the line of text, only occupying the horizontal space needed for their content. They don’t start on a new line and can wrap around other inline elements.
e.g <b> <span> <a></a></span></b>
Block elements start on a new line and typically occupy the full available horizontal width by default. <h1> <p> <div>