Class 10 Exam  >  Class 10 Notes  >  Computer Application: Class 10  >  Assignment: Cascading Style Sheets (CSS)

Assignment: Cascading Style Sheets (CSS) | Computer Application: Class 10 PDF Download

Multiple Choice Questions

Q1. The acronym CSS stands for what ?
(a) Carrot System Style
(b) Correlated Styling System
(c) Cascading Style Sheets
(d) Canvas Styling System

Ans. (c) Cascading Style Sheets
CSS stands for Cascading Style Sheets.

Q2. What property would you use to create space between the element's border and inner content ?
(a) padding
(b) spacing
(c) margin
(d) border

Ans. (a) padding
Padding defines the inner distance between the border and the content of the element.

Q3. To reference a style sheet across multiple HTML pages, how would you define your CSS ?
(a) Inline Style
(b) Internal Style Sheet
(c) External Style Sheet
(d) CSS is meant for only one page

Ans. (c) External Style Sheet
To reference a style sheet across multiple HTML pages, we define our CSS as an external style sheet.

Q4. What is the correct CSS syntax for making all the <span> elements bold ?
(a) span {text-size:bold}
(b) span {font-weight:bold}
(c) <span style="font-size:bold">
(d) <span style="text-size:bold">

Ans. (b) span {font-weight:bold}
The property font-weight specifies the boldness or heaviness for a font. In the given code, the content of span is set to bold.

Q5. What property is used to change the text color of an element ?
(a) fontcolor:
(b) textcolor:
(c) color:
(d) font-color:

Ans. (c) color:
color property is used to change the text color of an element. For example:
p {color : red ;}

Q6. Which is the correct CSS syntax ?
(a) {p:color=black(p}
(b) p {color: black;}
(c) {p;color:black}
(d) p:color=black

Ans. (b) p {color: black;}

The correct CSS syntax is :

selector {color : value ;}

The option p {color: black;} follows correct CSS syntax.

Q7. Which HTML attribute is used to define inline CSS styles ?
(a) css
(b) id
(c) type
(d) style

Ans. (d) style
STYLE attribute is used to define inline CSS styles. For example,

<H3 STYLE = "FONT-FAMILY = ARIAL">

Q8. How do you make each word in a text start with a capital letter ?
(a) text-transform:capitalize
(b) text-transform:uppercase
(c) You can't do that with CSS
(d) text:capitalize

Ans. (a) text-transform:capitalize
When the value of text-transform is set to capitalize, it will capitalize the first letter of each word.

Q9. Which CSS property controls the text size ?
(a) font-height
(b) text-size
(c) font-size
(d) text-style

Ans. (c) font-size
font-size property is used to set the size of a font.

Q10. How do you insert padding so that it is :
10 pixels at the top
15 pixels at the bottom
5 pixels at the right
10 pixels to the left
(a) padding:10px 15px 5px 10px ;
(b) padding:15px 5px 10px 10px ;
(c) padding:10px 5px 10px 15px ;
(d) padding:10px 5px 15px 10px ;

Ans. (d) padding:10px 5px 15px 10px ;

The order of padding values is top, right, bottom and left. Thus, to insert the given padding, we write the definition as follows:

padding:10px 5px 15px 10px ;

Theoretical Questions

Q1. Use the CSS ............... property to configure the cellpadding of a table.

Ans. table   { padding : 50px 20px 20px 20px ; }

Q2. What is the utility of dynamic websites ?

Ans. The utility of dynamic websites are as follows:

  1. Dynamic websites allow easy content updates.
  2. They tailor content based on user preferences.
  3. They enable feedback forms, comment sections, and social media integration.
  4. They can fetch and display real-time data from databases or APIs enabling live updates like news feeds, stock market information, weather updates, etc.
  5. They support online transactions and inventory management.
  6. They handle large amounts of content and user traffic.
  7. They streamline processes and save time.

Q3. What are some features of dynamic websites ?

Ans. Some features of dynamic websites are as follows:

  1. User registration and authentication can be done.
  2. Content management system (CMS) provides for easy content updates.
  3. Search functionality to find specific content.
  4. Database integration for dynamic content generation.
  5. Interactive forms for user engagement.
  6. E-commerce capabilities for online transactions.
  7. Social media integration for sharing and interaction.
  8. Personalization based on user preferences.
  9. Dynamic content delivery for customized user experiences.
  10. Analytics and tracking to gather data for analysis and optimization.

Q4. What do you understand by Stylesheets? How are these useful ?

Ans. A style sheet is a file containing formatting guidelines that define the overall look of a document.
Style sheets are useful in the following ways:

  1. It helps to separate structure and presentation. The HTML file can include structure tags and style sheet takes care of the presentation of content.
  2. Web pages download much faster.
  3. Developers have to type less code, and the web pages are shorter and neater.
  4. The look of the site is kept consistent throughout all the pages that work off the same style sheet.
  5. Updating design and general site maintenance are made much easier.
  6. Errors caused by editing multiple HTML pages occur less often.

Q5. What is CSS style rule? How do you define it ?

Ans. A CSS rule is a single statement in a style sheet that identifies what should be styled (the selector) and how those styles should be applied (the declaration).

We define a rule by writing the selector tag without angle brackets. The properties and their values are written in the following syntax:

selector { propertyname : value ; propertyname : value ; ...}

For example, if we want <H3 tag to have font face Arial and red color then we define the style rule as follows:

h3 { font-family : Arial ; color : red ; }

Q6. What are three ways of creating style rules? Give examples of each.

Ans. The three ways of creating style rules are as follows:

1. Inline — Styles are embedded right within the HTML code they affect. For example,

<h3 style = "font-family = Arial ; color = red ">

2. Internal — Styles are placed within the header information of the web page and then affect all the corresponding tags on the page. For example,

<HEAD>

<STYLE TYPE = "TEXT/CSS">

h3 { font-family : Arial ; color : red ; }

</STYLE>

</HEAD>

3. External — Styles are coded in a separate document, which is then referenced from within the header of the actual web page. For example, let there be a CSS file named sample.css :

h3 { font-family : Arial ; color : red ; }

p { font-family : Times New Roman ; color : blue ; }

...and so on...

To link sample.css file to an HTML document, we use the <link tag in the following manner:

<HEAD>

<LINK REL = "STYLE SHEET" TYPE = "TEXT/CSS" HREF = "SAMPLE.CSS">

</HEAD>

Q7. What is the Cascading order of different style types ?

Ans. The cascading order of different style types from higher precedence to lower precedence is :

  1. Inline
  2. Internal
  3. External

Q8. Where do you place the code to associate a Web page with an external style sheet ?

Ans. To associate a Web page with an external style sheet, we place the code in the head tag in the following manner :

<HEAD>

<LINK REL = "STYLE SHEET" TYPE = "TEXT/CSS" HREF = "SAMPLE.CSS">

</HEAD>

where, sample.css is the name of the CSS file.

The document Assignment: Cascading Style Sheets (CSS) | Computer Application: Class 10 is a part of the Class 10 Course Computer Application: Class 10.
All you need of Class 10 at this link: Class 10
10 videos|97 docs|18 tests

FAQs on Assignment: Cascading Style Sheets (CSS) - Computer Application: Class 10

1. What is the purpose of Cascading Style Sheets (CSS) in web development?
Ans. Cascading Style Sheets (CSS) are used in web development to control the presentation and layout of web pages. CSS allows developers to separate content from design, enabling them to apply styles such as colors, fonts, spacing, and positioning across multiple pages efficiently. This separation enhances maintainability and consistency in web design.
2. How do CSS selectors work, and what are the different types?
Ans. CSS selectors are patterns used to select the elements you want to style. The different types of selectors include: 1. <b>Universal Selector (*)</b>: Selects all elements. 2. <b>Type Selector (element)</b>: Selects all instances of a specific HTML element (e.g., div, p). 3. <b>Class Selector (.class)</b>: Selects elements with a specific class attribute. 4. <b>ID Selector (#id)</b>: Selects a single element with a specific ID. 5. <b>Attribute Selector ([attribute])</b>: Selects elements with a particular attribute. 6. <b>Pseudo-class Selector (:pseudo-class)</b>: Selects elements based on their state (e.g., :hover). By using these selectors, developers can target specific elements and apply styles accordingly.
3. What are CSS properties, and how do they affect the styling of an element?
Ans. CSS properties define the specific style characteristics applied to an element. Each property has a name and a value, such as `color: red;` or `font-size: 16px;`. Properties influence various aspects of element presentation, including: - <b>Text properties</b>: Such as font-family, font-size, and text-align. - <b>Box model properties</b>: Such as width, height, margin, padding, and border. - <b>Background properties</b>: Such as background-color, background-image, and background-repeat. By setting different properties, developers can create visually appealing and user-friendly web pages.
4. What is the box model in CSS, and why is it important?
Ans. The box model in CSS describes the rectangular boxes generated for elements in the document tree. Each box consists of the following components, in order from the inside out: 1. <b>Content</b>: The actual content of the element (text, images). 2. <b>Padding</b>: The space between the content and the border. 3. <b>Border</b>: The line surrounding the padding (if any). 4. <b>Margin</b>: The space outside the border, separating the element from others. Understanding the box model is crucial for effective layout design and spacing, as it affects how elements interact and display on the page.
5. How can CSS be used for responsive web design?
Ans. CSS can be utilized for responsive web design through techniques such as: 1. <b>Media Queries</b>: Allow developers to apply different styles based on the device's characteristics, like screen width and height. 2. <b>Flexible Grid Layouts</b>: Using relative units (like percentages) instead of fixed units (like pixels) enables elements to resize fluidly. 3. <b>Flexible Images</b>: Setting images to a maximum width of 100% ensures they scale within their containing elements. 4. <b>Viewport Units</b>: Utilizing units like vw (viewport width) and vh (viewport height) helps in creating layouts that adapt to different screen sizes. These strategies ensure that websites display well on a wide range of devices, from desktops to smartphones.
Related Searches

Assignment: Cascading Style Sheets (CSS) | Computer Application: Class 10

,

shortcuts and tricks

,

Sample Paper

,

past year papers

,

Assignment: Cascading Style Sheets (CSS) | Computer Application: Class 10

,

pdf

,

mock tests for examination

,

practice quizzes

,

Summary

,

Previous Year Questions with Solutions

,

study material

,

Assignment: Cascading Style Sheets (CSS) | Computer Application: Class 10

,

Exam

,

Semester Notes

,

MCQs

,

Viva Questions

,

video lectures

,

Extra Questions

,

Important questions

,

Free

,

Objective type Questions

,

ppt

;