CSS BASICS Class 7
CSS BASICS Class 7
A. Tick the correct option.
Which style sheet uses style as an element?
a. Internal
The
<style>is used inside which element?b.
<head>
Find the odd one out.
a. Font-face (Note:
font-size,font-family, andfont-weightare standard CSS text styling properties, whereas@font-faceis an at-rule used to load custom web fonts).
Which of these properties changes the case of the text in CSS?
d. Text-transform
What are the different ways to specify colour in CSS?
d. All of these (Colors can be specified using color names, hexadecimal codes, and RGB values)
.
B. Fill in the blanks.
You use
<style>element in embedded style sheet to define properties. The xx-large, small and medium values can be given to
font-sizeproperty. Another name for elements in CSS is selectors
. To display a text in lowercase,
text-transformproperty is used. font-weightproperty displays the text as bolder.
C. State True or False.
CSS helps a webpage to look more attractive
. True
Internal CSS helps to use the style attribute of an HTML document
. False (Internal CSS uses the
<style>element inside the<head>section, whereas thestyleattribute is used for inline CSS).
The font-style allows to make the text bolder
. False (The
font-weightproperty is used to make text bolder, whilefont-styleis typically used for italic text). Text-alignment property allows you to decorate the text
. False (
text-alignspecifies the horizontal alignment of text, whiletext-decorationis used to decorate the text like underlines).
You need to specify the background image with the help of URL of the image
. True (Using
background-image: url(...)).
D. Rewrite the following codes correctly.
Original:
<p style: "font-size: 40; border-type: dashed"> Hello Friends </p>
<h1 style="text-decoration: line through; text-decoration: uppercase"><p style="font-type: arial; text-decoration; underline">E. Answer the following questions.
Define CSS.
CSS stands for Cascading Style Sheets. It is a stylesheet language used to describe the presentation, layout, and styling (such as colors, fonts, and spacing) of a webpage written in HTML.
Differentiate between CSS and HTML.
HTML (HyperText Markup Language): Used to create the structure and content of a webpage (e.g., headings, paragraphs, images).
CSS (Cascading Style Sheets): Used to design and style that structure (e.g., changing colors, font styles, and background design).
What are the different types of style sheets used in CSS?
The three types of style sheets are:
Inline Style Sheet (using the
styleattribute on individual elements)Internal / Embedded Style Sheet (using the
<style>element in the<head>section)External Style Sheet (using a separate
.cssfile linked via the<link>tag)
Write the code to change the text colour of H1 to blue colour.
Using inline style:
What is the significance of text-decoration property?
The
text-decorationproperty is used to add or remove decorations from text, such as underlining (underline), overlining, line-throughs (line-through), or removing default links underlining (none).
Write a difference between internal and inline style sheets.
Internal Style Sheet: Defined inside the
<head>section using the<style>tag and applies to the entire single webpage document.Inline Style Sheet: Applied directly to a specific HTML element using the
styleattribute, affecting only that single element.
Explain the different properties of text in CSS.
Common text properties in CSS include:
color: Sets the color of the text.font-family: Specifies the font face for the text.font-size: Controls the size of the text.font-weight: Specifies the boldness or thickness of the text.text-align: Aligns the text horizontally (left, right, center, justify).text-transform: Controls the capitalization of text (uppercase, lowercase, capitalize).text-decoration: Adds special features like underlines or strikethroughs.
What are the different ways to include CSS in HTML?
CSS can be included in HTML in three ways:
Inline (using the
styleattribute)Internal (using the
<style>tag in the<head>)External (using the
<link>tag to connect an external.cssfile)
Write any three advantages of CSS.
Consistency: You can change the style of multiple pages at once by updating a single external CSS file.
Faster Page Loading: Since style rules are written once and reused across elements or pages, it reduces code duplication.
Better Formatting Control: CSS offers much more detailed and flexible layout and design options compared to standard HTML attributes.
What is the difference between background-color and background-image properties in CSS?
background-color: Sets a solid color as the background of an element.background-image: Sets an image (specified via a URL) as the background of an element.
Comments
Post a Comment