Exam paper 2 Flashcards

1
Q

provide an example on inline CSS and explain why it is often considered as bad practice in web design and provide different way of specify CSS for a webpage

A

<p>This text is styled with inline CSS</p>

Inline CSS involves writing CSS styles directly into HTML elements using the “style” attribute. While inline CSS can be useful for quickly applying styles to specific elements, it is generally considered a bad practice in web design for several reasons:

Maintenance: Inline CSS can make your code difficult to maintain, as it requires updating the CSS styles for each individual element rather than simply updating a single CSS file.

Readability: Inline CSS can make your HTML code difficult to read and understand, as it mixes styling information with content.

Specificity: Inline CSS has a high level of specificity, which can make it difficult to override with other styles.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Define bootstrap and why should we use bootstrap in a web design

A

It is front-end development framework that provides a collection of HTML, CSS, and JavaScript components for building responsive and mobile-first websites and web applications. Bootstrap is designed to make web development faster and easier, by providing a pre-built set of UI components and styles that can be easily customized to fit the design needs of a website.

Responsiveness: Bootstrap is designed to be mobile-first, meaning that it includes features and styles that make it easy to create websites that look great on mobile devices as well as desktops.

Consistency: Bootstrap provides a consistent set of UI components and styles that can be easily reused across a website or web application, helping to ensure a consistent user experience.

Community support: Bootstrap has a large and active community of developers, which provides a wealth of resources and support for users, including documentation, tutorials, and forums.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

write the audio and video code for a web page

A

<!-- Audio Player -->

<audio>
<source></source>
Your browser does not support the audio element.
</audio>

<!-- Video Player -->

<video>
<source></source>
Your browser does not support the video tag.
</video>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Write the code to display 3 hyperlinks to different website, the website should be open in a new window when clicked. explain the code for the hyperlinks

A

<!DOCTYPE html>

<html>
<head>
<title>My Webpage</title>
</head>
<body>
<p>Check out these awesome websites:</p>
<ul>
<li><a>Example 1</a></li>
<li><a>Example 2</a></li>
<li><a>Example 3</a></li>
</ul>
</body>
</html>

we have used the HTML <a> tag to create hyperlinks to three different websites. The href attribute specifies the URL of the website, while the target attribute with the value _blank opens the website in a new window when clicked.</a>

The <ul> tag is used to create an unordered list, and each <li> tag represents a list item that contains the hyperlink. You can style the hyperlinks using CSS to match your webpage’s design and add hover effects or change the text color.

Note that opening links in a new window is not always recommended, as it can be disruptive to the user’s browsing experience. It’s better to give the user the choice to open the link in the same window or a new window/tab using appropriate language and design.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what is an accessible website and what are the main accessibility traits that this standard helps you implement it

A

An accessible website is a website that is designed for all users, including those with disabilities. It provides equal access to content and functionality by removing barriers and ensuring that the website is easy to use for everyone.

The main accessibility traits that an accessible website should have are:

Perceivable: Users should be able to perceive and access all website content, including images, videos, and audio.
Operable: Users should be able to operate and interact with the website, including using a keyboard instead of a mouse.
Understandable: Users should be able to understand the content and the way the website is organized.
Robust: The website should be able to function with a variety of web browsers and assistive technologies.
By implementing these traits, web designers and developers can ensure that their website is accessible to all users, regardless of their abilities.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Name two jQuery event methods used by developers?

A

$(“#myButton”).click(function() {
// Code to execute when the button is clicked
});
——————————————————————-
$(“#myForm”).submit(function() {
// Code to execute when the form is submitted
});

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Define the term Web Hosting and briefly Explain the different type of a web hosting available

A

Shared Hosting: It is an affordable option for small websites and blogs that don’t require a lot of resources.

Dedicated Hosting: It is a more expensive option but offers more resources, flexibility, and control.

Reseller Hosting: It is a good option for those looking to start a hosting business or manage multiple websites.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly