Q: 1 Which CSS property can provide to add an effect when changing from one style to another, without using flash animations or JavaScript?
Associations
Transitions
Transistor
None of the above
[ Option B ]
The CSS transition property allows you to add smooth effects when changing from one style to another without using flash animations or JavaScript. Transitions enhance user experience by providing visually appealing animations with minimal effort and without complex scripting.
It provides control over the duration, timing function, and delay of the change, enabling smooth gradual changes, such as fading colors, resizing elements, or moving components when a user interacts with a page.
button {
background-color: yellow;
transition: background-color 1s ease;
}
button:hover {
background-color: green;
}In this example, when the user hovers over the button, the background color smoothly changes from yellow to green in 1 seconds.
Q: 2 Which of the following is NOT true about Cascading Style Sheets (CSS)?
CSS can control the layout of multiple web pages
CSS supports style formatting in HTML pages
Style definitions can be saved in an external CSS file
Only one CSS can be used in a HTML file
[ Option D ]
CSS (Cascading Style Sheets) is used to control the presentation and layout of HTML documents. It separates content (HTML) from design (CSS), making web pages easier to manage and maintain.
| Statement | True / False | Explanation |
|---|---|---|
| CSS can control the layout of multiple web pages. | True | One external CSS file can be linked to many HTML pages. |
| CSS supports style formatting in HTML pages. | True | CSS is specifically designed for styling HTML elements. |
| Style definitions can be saved in an external CSS file. | True | External CSS files (.css) are commonly used. |
| Only one CSS can be used in a HTML file. | False | Multiple CSS files can be linked in one HTML document. |
CSS can be applied in three ways:
1. Inline CSS.
2. Internal CSS.
3. External CSS.
The term “Cascading” means:
Q: 3 Which of the following is an advantage of using a separate CSS file in HTML?
The content becomes easy to manage
Easier to design sites for different devices like mobile
CSS files are cached and decrease server load and network traffic
All of the above
[ Option D ]
In web development, using a separate CSS (Cascading Style Sheets) file helps in maintaining better structure and efficiency. It separates the design (CSS) from the content (HTML), which makes the code cleaner and easier to manage.
A separate CSS file allows developers to modify styles in one place, making content management easier.
It also helps in creating responsive designs for different devices like mobiles and tablets.
Additionally, CSS files are cached by the browser, which reduces server load and improves page loading speed.
Thank you so much for taking the time to read my Computer Science MCQs section carefully. Your support and interest mean a lot, and I truly appreciate you being part of this journey. Stay connected for more insights and updates! If you'd like to explore more tutorials and insights, check out my YouTube channel.
Don’t forget to subscribe and stay connected for future updates.