Web Designing and Publishing M2R5 MCQ. Prepare for M2R5 with 100 objective questions on Web Designing & Publishing. Covers HTML, CSS, JS basics & publishing. Answers included.
Web Designing and Publishing M2R5 MCQ – Mock Online Test
Question 1: Which of the following is NOT a common type of website?
Show Explanation
Correct Answer: D. Operating system. Operating systems are software that manage computer hardware and resources, not a type of website.
Question 2: What is the primary role of a front-end application in web design?
Show Explanation
Correct Answer: C. Creating the user interface. Front-end applications focus on the visual elements and user experience of a website.
Question 3: Which of the following is an example of server-side scripting?
Show Explanation
Correct Answer: D. PHP. PHP is a server-side scripting language used to generate dynamic web content.
Question 4: What is the purpose of client-side scripting?
Show Explanation
Correct Answer: B. To interact with the user’s browser. Client-side scripting languages like JavaScript enhance user interaction within the web browser.
Question 5: Which type of website is primarily used to showcase an individual’s work or skills?
Show Explanation
Correct Answer: B. Portfolio website. Portfolio websites are designed to display a collection of an individual’s projects and achievements.
Question 6: What is the main difference between a static website and a dynamic website?
Show Explanation
Correct Answer: B. Static websites have fixed content, while dynamic websites can change content based on user interaction. Dynamic websites can personalize content and respond to user actions.
Question 7: Which of the following is a benefit of using a Content Management System (CMS) for building a website?
Show Explanation
Correct Answer: C. Easy content updates and management. CMS platforms provide user-friendly interfaces for managing website content.
Question 8: What is the role of a back-end application in web design?
Show Explanation
Correct Answer: B. Handling server-side logic and data storage. Back-end applications manage databases, user authentication, and other server-side processes.
Question 9: Which of the following is an example of a client-side scripting language?
Show Explanation
Correct Answer: D. JavaScript. JavaScript is primarily used for client-side scripting to add interactivity to web pages.
Question 10: What is the purpose of a domain name?
Show Explanation
Correct Answer: A. To provide a unique address for a website. Domain names make it easy for users to find and access websites.
Question 11: Which of the following is a popular code editor used for web development?
Show Explanation
Correct Answer: C. Visual Studio Code. Visual Studio Code is a versatile code editor with features that support web development.
Question 12: What is the primary function of a code editor?
Show Explanation
Correct Answer: B. To write and edit code. Code editors provide an environment for writing and modifying code.
Question 13: Which feature of code editors helps in identifying errors in code?
Show Explanation
Correct Answer: D. Debugging tools. Debugging tools allow developers to identify and fix errors in their code.
Question 14: What is the purpose of syntax highlighting in code editors?
Show Explanation
Correct Answer: B. To make code more visually appealing and easier to read. Syntax highlighting uses different colors to differentiate code elements.
Question 15: Which code editor is specifically designed for web development?
Show Explanation
Correct Answer: D. All of the above. Notepad++, Sublime Text, and Atom are popular code editors suitable for web development.
Question 16: What is the benefit of using an Integrated Development Environment (IDE) for web development?
Show Explanation
Correct Answer: B. IDEs offer a comprehensive set of tools for coding, debugging, and testing. IDEs provide a more complete development environment compared to basic code editors.
Question 17: Which feature of code editors allows developers to track changes made to their code?
Show Explanation
Correct Answer: C. Version control. Version control systems help manage code revisions and collaboration.
Question 18: What is the purpose of code completion in code editors?
Show Explanation
Correct Answer: B. To suggest code snippets and function names as you type. Code completion speeds up development by providing code suggestions.
Question 19: Which of the following is NOT a common feature of code editors?
Show Explanation
Correct Answer: A. Built-in web server. While some IDEs may include a built-in web server, it’s not a standard feature of code editors.
Question 20: How do code editors contribute to efficient web development?
Show Explanation
Correct Answer: A. By providing a distraction-free writing environment. Code editors offer a focused environment for writing and editing code.
Question 21: What does HTML stand for?
Show Explanation
Correct Answer: A. Hyper Text Markup Language. HTML is the standard language for creating web pages.
Question 22: Which tag is used to create a hyperlink in HTML?
Show Explanation
Correct Answer: B. <a>
. The <a>
tag defines a hyperlink, which links one page to another.
Question 23: What is the correct HTML element for inserting a line break?
Show Explanation
Correct Answer: C. <br>
. The <br>
tag inserts a single line break.
Question 24: Which HTML tag is used to define the largest heading?
Show Explanation
Correct Answer: A. <h1>
. <h1>
represents the highest level of heading.
Question 25: What is the correct HTML for adding an image?
Show Explanation
Correct Answer: A. <img src="image.gif" alt="MyImage">
. This is the correct syntax for the image tag, specifying the source (src
) and alternative text (alt
).
Question 26: Which tag is used to create an unordered list in HTML?
Show Explanation
Correct Answer: B. <ul>
. The <ul>
tag defines an unordered list with bullet points.
Question 27: What does the <p>
tag stand for in HTML?
Show Explanation
Correct Answer: B. Paragraph. The <p>
tag defines a paragraph.
Question 28: Which attribute is used to define inline styles in HTML?
Show Explanation
Correct Answer: B. style
. The style
attribute allows you to specify CSS styles directly within an HTML tag.
Question 29: What is the purpose of the alt
attribute in an image tag?
Show Explanation
Correct Answer: A. To provide alternative text if the image cannot be displayed. The alt
attribute is important for accessibility and SEO.
Question 30: Which HTML tag is used to create a table?
Show Explanation
Correct Answer: A. <table>
. The <table>
tag defines an HTML table.
Question 31: What does CSS stand for?
Show Explanation
Correct Answer: A. Cascading Style Sheets. CSS is used to style the presentation of web pages.
Question 32: Which CSS property is used to change the text color of an element?
Show Explanation
Correct Answer: C. color
. The color
property sets the color of the text.
Question 33: What is the correct CSS syntax for changing the background color of an element?
Show Explanation
Correct Answer: A. background-color: yellow;
. This is the correct syntax for the background-color property.
Question 34: Which CSS property is used to change the font size of an element?
Show Explanation
Correct Answer: C. font-size
. The font-size
property controls the size of the text.
Question 35: What is the purpose of an external style sheet?
Show Explanation
Correct Answer: B. To apply styles to multiple web pages. External style sheets promote consistency and maintainability.
Question 36: How do you insert a comment in a CSS file?
Show Explanation
Correct Answer: C./ This is a comment */`. This is the correct syntax for CSS comments.
Question 37: Which CSS property is used to add spacing between HTML elements?
Show Explanation
Correct Answer: C. margin
. The margin
property creates space outside an element’s border.
Question 38: What is the purpose of the !important
declaration in CSS?
Show Explanation
Correct Answer: B. To override all other style declarations. !important
gives a style rule higher precedence.
Question 39: Which CSS property is used to control the alignment of text within an element?
Show Explanation
Correct Answer: A. text-align
. The text-align
property aligns text left, right, center, or justify.
Question 40: What is the box model in CSS?
Show Explanation
Correct Answer: A. A way to visualize the structure of HTML elements and their spacing. The box model describes the content, padding, border, and margin of an element.
Question 41: What is the primary purpose of a CSS framework?
Show Explanation
Correct Answer: B. To provide a set of pre-written CSS rules for common styling tasks. CSS frameworks streamline development by offering ready-made styles.
Question 42: Which of the following is a popular CSS framework?
Show Explanation
Correct Answer: A. Bootstrap. Bootstrap is a widely used CSS framework for responsive web design.
Question 43: What is a key benefit of using a CSS framework?
Show Explanation
Correct Answer: B. Reduced code complexity and improved maintainability. CSS frameworks promote consistency and efficiency.
Question 44: Which CSS framework component is used to create a responsive grid layout?
Show Explanation
Correct Answer: C. Grid system. Grid systems help structure content and adapt to different screen sizes.
Question 45: What is the purpose of CSS framework utilities?
Show Explanation
Correct Answer: B. To provide pre-defined styles for common UI elements like buttons and forms. Utilities offer shortcuts for styling common elements.
Question 46: Which CSS framework is known for its mobile-first approach?
Show Explanation
Correct Answer: C. Bootstrap. Bootstrap prioritizes mobile design and scales up gracefully to larger screens.
Question 47: What is a CSS framework theme?
Show Explanation
Correct Answer: A. A set of custom CSS rules that modify the framework’s default styles. Themes allow for customization of the framework’s appearance.
Question 48: Which CSS framework is known for its utility-first approach?
Show Explanation
Correct Answer: B. Tailwind CSS. Tailwind CSS provides a vast collection of utility classes for granular styling.
Question 49: What is a potential drawback of using a CSS framework?
Show Explanation
Correct Answer: A. Increased website loading times due to large file sizes. Some frameworks can add significant overhead if not optimized or if unused styles are included.
Question 50: How do CSS frameworks contribute to consistent web design?
Show Explanation
Correct Answer: A. By enforcing a standardized set of styles and components. CSS frameworks provide a consistent visual language.
Question 51: What is the primary purpose of JavaScript in web development?
Show Explanation
Correct Answer: C. To add interactivity and dynamic behavior to websites. JavaScript enables interactive elements and client-side scripting.
Question 52: Which of the following is NOT a data type in JavaScript?
Show Explanation
Correct Answer: D. ArrayList. ArrayList is not a standard primitive data type in JavaScript; the equivalent is Array.
Question 53: What is the purpose of the getElementById()
method in JavaScript?
Show Explanation
Correct Answer: A. To select an HTML element by its ID attribute. getElementById()
is used to access specific elements in the Document Object Model (DOM).
Question 54: Which JavaScript operator is used to compare two values for equality, considering type?
Show Explanation
Correct Answer: C. ===
. The ===
operator (strict equality) checks for both value and type equality.
Question 55: What is the purpose of a JavaScript function?
Show Explanation
Correct Answer: A. To define a block of code that can be reused multiple times. Functions promote code organization and reusability.
Question 56: What is the correct syntax for a for
loop in JavaScript?
Show Explanation
Correct Answer: A. for (i = 0; i <= 5; i++)
. This is the standard syntax for a for
loop in JavaScript, initializing a variable, setting a condition, and defining an increment.
Question 57: What is the purpose of the addEventListener()
method in JavaScript?
Show Explanation
Correct Answer: B. To attach an event handler to an HTML element. addEventListener()
allows you to execute code when a specific event (like a click or keypress) occurs on an element.
Question 58: What is AngularJS?
Show Explanation
Correct Answer: C. A JavaScript framework for building single-page applications. AngularJS (often referred to as Angular 1.x) provides a structure for creating dynamic and interactive web apps.
Question 59: What is the purpose of data binding in AngularJS?
Show Explanation
Correct Answer: A. To connect the model (data) to the view (HTML). Data binding automatically keeps the view and the model synchronized.
Question 60: Which directive is used to repeat an HTML element in AngularJS?
Show Explanation
Correct Answer: A. ng-repeat
. ng-repeat
iterates over a collection (like an array) and creates multiple instances of an HTML element for each item in the collection.
Question 61: What is the purpose of the ng-model
directive in AngularJS?
Show Explanation
Correct Answer: A. To bind the value of an HTML element to a variable in the scope. ng-model
enables two-way data binding.
Question 62: What is a controller in AngularJS?
Show Explanation
Correct Answer: A. A JavaScript function that controls the data and behavior of an application. Controllers manage the application’s logic and interact with the scope.
Question 63: What is the purpose of the $scope
object in AngularJS?
Show Explanation
Correct Answer: A. To store data that can be accessed by the view and the controller. $scope
acts as the glue between the controller and the view.
Question 64: Which of the following is NOT a built-in AngularJS service?
Show Explanation
Correct Answer: B. $scope
. While $scope
is a fundamental object passed into controllers, it’s not technically a service like $http
or $location
that you inject.
Question 65: What is the purpose of the $http
service in AngularJS?
Show Explanation
Correct Answer: A. To make HTTP requests to a server. $http
enables communication with back-end APIs to fetch or send data.
Question 66: What is a directive in AngularJS?
Show Explanation
Correct Answer: A. A marker on an HTML element that tells AngularJS to attach specific behavior. Directives extend HTML with custom functionality (e.g., ng-repeat
, ng-model
).
Question 67: What is the purpose of the ng-app
directive in AngularJS?
Show Explanation
Correct Answer: A. To define the root element of an AngularJS application. ng-app
bootstraps the AngularJS application and tells Angular where the application begins.
Question 68: What is a filter in AngularJS?
Show Explanation
Correct Answer: A. A function that formats or transforms data for display in the view. Filters modify data before it’s rendered (e.g., formatting currency or dates).
Question 69: Which of the following is NOT a valid form of data binding in AngularJS?
Show Explanation
Correct Answer: C. Three-way binding. AngularJS primarily uses one-way (controller to view or vice versa) and two-way (controller and view synchronized) data binding. Event binding is also a concept used.
Question 70: What is the purpose of client-side validation in web forms?
Show Explanation
Correct Answer: A. To ensure that data is entered in the correct format before it’s sent to the server. Client-side validation provides immediate feedback to the user and reduces server load.
Question 71: Which of the following is a popular photo editing software?
Show Explanation
Correct Answer: A. Adobe Photoshop. Adobe Photoshop is an industry-standard raster graphics editor.
Question 72: What is the purpose of cropping an image?
Show Explanation
Correct Answer: A. To remove unwanted parts of an image. Cropping allows you to change the composition or aspect ratio by trimming edges.
Question 73: Which tool is used to select a specific area of an image in a photo editor?
Show Explanation
Correct Answer: C. Selection tool. Tools like Marquee, Lasso, or Magic Wand are used to isolate parts of an image for editing.
Question 74: What is the purpose of resizing an image?
Show Explanation
Correct Answer: A. To change the dimensions of an image. Resizing modifies the width and height, affecting the overall size and resolution.
Question 75: Which file format is commonly used for web images with complex colors and gradients?
Show Explanation
Correct Answer: C. JPEG. JPEG (or JPG) is a lossy compression format well-suited for photographs and complex images on the web.
Question 76: What is the purpose of image optimization?
Show Explanation
Correct Answer: A. To reduce the file size of an image without significant loss of quality. Image optimization is crucial for faster website loading times.
Question 77: Which photo editing tool is used to remove blemishes or imperfections from an image?
Show Explanation
Correct Answer: D. All of the above. These tools are designed for retouching by sampling textures from nearby areas to seamlessly cover imperfections.
Question 78: What is the purpose of layers in photo editing?
Show Explanation
Correct Answer: A. To organize and edit different parts of an image independently. Layers allow for non-destructive editing, making it easy to modify or remove adjustments.
Question 79: Which color model is commonly used for web images?
Show Explanation
Correct Answer: B. RGB. RGB (Red, Green, Blue) is the additive color model used by digital displays like monitors and screens.
Question 80: What is the purpose of the “Save for Web” feature in photo editors?
Show Explanation
Correct Answer: A. To optimize images for web use. This feature typically allows fine-tuning of compression levels and file formats to balance quality and file size for web performance.
Question 81: What is the difference between lossy and lossless image compression?
Show Explanation
Correct Answer: A. Lossy compression reduces file size by permanently discarding some image data, while lossless compression reduces file size without losing any data.
Question 82: Which image file format supports transparency?
Show Explanation
Correct Answer: D. Both B and C. PNG (Portable Network Graphics) and GIF (Graphics Interchange Format) support transparency, allowing backgrounds to show through.
Question 83: What is the purpose of image editing in web design?
Show Explanation
Correct Answer: A. To enhance the visual appeal of a website. Edited and optimized images contribute significantly to a website’s aesthetics and user engagement.
Question 84: How can you embed an image into a web page?
Show Explanation
Correct Answer: A. By using the <img>
tag in HTML. The src
attribute within the <img>
tag specifies the path to the image file (which could be hosted locally or on a server).
Question 85: What is the purpose of the src
attribute in an image tag?
Show Explanation
Correct Answer: A. To specify the image file path or URL. The src
(source) attribute tells the browser where to find the image file to display.
Question 86: What is the purpose of web publishing?
Show Explanation
Correct Answer: A. To make a website accessible on the internet. Web publishing involves uploading the website’s files to a web server connected to the internet.
Question 87: Which protocol is used to transfer files over the internet?
Show Explanation
Correct Answer: B. FTP. FTP (File Transfer Protocol) is specifically designed for uploading and downloading files between computers.
Question 88: What is a web server?
Show Explanation
Correct Answer: A. A computer that stores website files and makes them available online. Web servers respond to requests from browsers and deliver web page content.
Question 89: What is the purpose of a web browser?
Show Explanation
Correct Answer: A. To access and view websites. Web browsers interpret HTML, CSS, and JavaScript code to render web pages for the user.
Question 90: Which of the following is NOT a popular web browser?
Show Explanation
Correct Answer: D. Adobe Photoshop. Adobe Photoshop is image editing software, not a tool for Browse the web.
Question 91: What is a URL?
Show Explanation
Correct Answer: A. The address of a website or web page. URLs (Uniform Resource Locators) are unique identifiers for resources on the internet.
Question 92: What is the purpose of a domain name registrar?
Show Explanation
Correct Answer: A. To sell domain names. Domain registrars are accredited companies that manage the reservation of internet domain names.
Question 93: What is web hosting?
Show Explanation
Correct Answer: A. The service of providing space on a web server to store website files. Web hosting companies provide the infrastructure needed to make websites accessible online.
Question 94: What is the purpose of a website’s homepage?
Show Explanation
Correct Answer: A. To serve as the main landing page and provide an overview of the website. The homepage typically introduces the site and provides navigation to other sections.
Question 95: What is a hyperlink?
Show Explanation
Correct Answer: A. A clickable link that takes you to another web page or resource. Hyperlinks are the foundation of navigating the World Wide Web.
Question 96: What is the purpose of a website’s navigation menu?
Show Explanation
Correct Answer: A. To help users find and access different sections of the website. Navigation menus provide structure and allow users to move between pages easily.
Question 97: What is a web page?
Show Explanation
Correct Answer: A. A single document that can be accessed through a web browser. Web pages are typically written in HTML and form the content of a website.
Question 98: What is the purpose of a search engine?
Show Explanation
Correct Answer: A. To help users find information on the internet. Search engines like Google crawl and index the web to provide relevant results to user queries.
Question 99: Which of the following is NOT a common way to publish a website?
Show Explanation
Correct Answer: C. Sharing files through email. Email is not designed for hosting or publishing websites; it’s for communication.
Question 100: What is the purpose of website maintenance?
Show Explanation
Correct Answer: A. To keep a website updated, secure, and functioning properly. Regular maintenance includes updates, backups, security checks, and content revisions.