All Exams  >   Class 6  >   CSS for Beginners  >   All Questions

All questions of CSS Basics - 2 for Class 6 Exam

Which of the following property is used to draw a line around elements outside the borders?
  • a)
    line
  • b)
    padding
  • c)
    outline
  • d)
    border
Correct answer is option 'C'. Can you explain this answer?

Explanation:

The correct answer is option 'C' - border.

In HTML, the border property is used to draw a line around elements outside the borders. It allows you to define the style, width, and color of the border. The border can be applied to various HTML elements such as divs, paragraphs, images, tables, etc.

HTML Border Styles:
There are several border styles available that can be applied using the border-style property. Some commonly used border styles are:

1. Solid: A simple solid line.
2. Dotted: A series of small dots.
3. Dashed: A series of short dashes.
4. Double: Two parallel lines.
5. Groove: A 3D grooved effect.
6. Ridge: A 3D ridged effect.
7. Inset: A 3D inset effect.
8. Outset: A 3D outset effect.

HTML Border Width:
The border-width property is used to specify the width of the border. It can be set to a specific value in pixels, or you can use keywords like "thin," "medium," or "thick" to define the width.

HTML Border Color:
The border-color property is used to set the color of the border. It can be specified using a color name, RGB values, or hexadecimal color codes.

Example:
Let's say we have a div element and we want to apply a border to it. Here's an example of how we can do it:

```html








This is a bordered div element

Hello, world!





```

In this example, we have applied a solid red border with a width of 2 pixels to the div element. The border is also given a border-radius of 5 pixels to make it slightly rounded. The padding property is used to create some space between the content and the border.

Summary:
The border property in HTML is used to draw a line around elements outside the borders. It allows you to define the style, width, and color of the border. The border can be applied to various HTML elements using the border-style, border-width, and border-color properties.
1 Crore+ students have signed up on EduRev. Have you? Download the App

Which of the following CSS property is used to set the text formatting?
  • a)
    font
  • b)
    font-style
  • c)
    text-decoration
  • d)
    all of the mentioned
Correct answer is option 'C'. Can you explain this answer?

Ameya Shah answered
The correct answer is option 'C', i.e., text-decoration.

Explanation:

CSS stands for Cascading Style Sheets, which is a style sheet language used to describe the presentation of a document written in HTML or XML. CSS is used to define styles for web pages, including the layout, colors, fonts, and more. One of the important features of CSS is its ability to format text in various ways.

The text-decoration property is used to set or remove decorations from the text content of an HTML element. It is one of the CSS properties used to format text on a web page.

Some of the common values for the text-decoration property are:

1. none: It removes any decorations from the text.

2. underline: It adds a single underline to the text.

3. overline: It adds a single line above the text.

4. line-through: It adds a single line through the text.

Conclusion:

In conclusion, the text-decoration property is used to set or remove decorations from the text content of an HTML element. It is an important CSS property used to format text on a web page.

Using a bogus image is also called as _______
  • a)
    The Leon method
  • b)
    The Levin Technique
  • c)
    Radu Darvas Shim
  • d)
    The Langridge method
Correct answer is option 'C'. Can you explain this answer?

Aditya Shah answered
This method also requires a bogus image in addition to a usual <span> element to work properly. The image is a 1×1 pixel transparent GIF. The main purpose is to show users the alt text if images are turned off.

Which of the following sets what kind of line decorations are added to an element, such as underlines, overlines, etc?
  • a)
    text-style
  • b)
    text-decoration
  • c)
    text-line
  • d)
    text-decoration-line
Correct answer is option 'A'. Can you explain this answer?

Answer:

The correct answer is option 'B' - text-decoration.

Explanation:

Text-decoration is a CSS property that allows you to set various line decorations to an element, such as underlines, overlines, line-throughs, and blinking effects. It is used to enhance the visual appearance of text content on a web page.

Usage:

To add line decorations to an element, you can use the text-decoration property in CSS. Here are the different values that can be assigned to this property:

1. none: No line decoration is added to the text. This is the default value.
2. underline: Adds a line below the text.
3. overline: Adds a line above the text.
4. line-through: Adds a line through the text.
5. blink: Makes the text blink on and off.

Example:

Let's consider an example where we want to add an underline decoration to a paragraph element. We can achieve this using the text-decoration property in CSS. Here's the code:

HTML:
```html
This is an example text.

```

CSS:
```css
.underline {
text-decoration: underline;
}
```

In the above example, the .underline class is applied to the paragraph element. The CSS rule with text-decoration: underline; sets an underline decoration to the text within the paragraph.

Additional Notes:

The text-decoration property can also be combined with other CSS properties to achieve more complex effects. For example, you can change the color of the line using the text-decoration-color property, control the thickness of the line using the text-decoration-thickness property, and adjust the position of the line using the text-decoration-skip property.

Using padding is also known as ________
  • a)
    Leon Dwyer method
  • b)
    Radu darvas method
  • c)
    Lindsay method
  • d)
    Langridge method
Correct answer is option 'D'. Can you explain this answer?

Aditya Shah answered
Using padding is known as Langridge method. We push the text outside of our header using padding-top property. The property is to be set to a value that is equal to the height of the logo. But this alone is not sufficient, we have to use overflow: hidden to hide the text.

Using Overflow is known as ______
  • a)
    The Leon method
  • b)
    The Scott Kellum method
  • c)
    The Phark method
  • d)
    The Langridge method
Correct answer is option 'A'. Can you explain this answer?

Aditya Shah answered
In this method, overflow property is used to hide the element completely. Using this technique requires to wrap the text in a <span> element just like the other methods. The text is hidden by overflow: hidden property.

Which of the following will represent browsers in their normal states?
  • a)
    CSS ON/Images ON
  • b)
    CSS ON/Images OFF
  • c)
    CSS OFF/Images ON
  • d)
    CSS OFF/Images OFF
Correct answer is option 'A'. Can you explain this answer?

Aditya Shah answered
There are five major categories for image replacement i.e. CSS ON/Images ON, CSS ON/Images OFF, CSS OFF/Images ON, CSS OFF/Images ON, CSS OFF/Images OFF, Extra Unnecessary Markup. CSS ON/Images ON represents browsers in their normal states and all the techniques should pass their test.

Which of the following technique is also known as Fahrner Image Replacement?
  • a)
    CSS ON/Images ON
  • b)
    CSS ON/Images OFF
  • c)
    CSS OFF/Images ON
  • d)
    CSS OFF/Images OFF
Correct answer is option 'A'. Can you explain this answer?

Aditya Shah answered
CSS ON/Images On technique is also known as FIR or “Fahrner Image Replacement”. The premise here is to use a span to wrap the text inside the header and use that span to hide the text. It works but we have to use display:none.

Which of the following CSS Property controls how an element is positioned?
  • a)
    position
  • b)
    set
  • c)
    static
  • d)
    fix
Correct answer is option 'A'. Can you explain this answer?

Avinash Patel answered
Controls how an element is positioned. When set to absolute or fixed, the element is removed completely from the normal flow of the document. When set to relative, the element is moved relative to its position in the normal flow, but a space is left where it would normally have been. The default value, static, means the element remains in the normal flow and is not positioned.

Using margin is also known as________
  • a)
    Fahrner image replacement
  • b)
    The Lindsay method
  • c)
    Radu Darvas Technique
  • d)
    The Langridge method
Correct answer is option 'C'. Can you explain this answer?

Aditya Shah answered
Using margin is also used as Radu Darvas technique. This technique also forces the text outside of the browser window but uses margins to do so. The main idea is to apply very large negative left margin and give our header a correspondingly large width.

Using negative text-indent is also known as _______
  • a)
    The Scott Kellum method
  • b)
    The Phark method
  • c)
    Radu Darvas Technique
  • d)
    The Langridge method
Correct answer is option 'B'. Can you explain this answer?

Aditya Shah answered
Using negative text-indent is also known as the Phark method. This is the most common technique that most web developers have used. The main idea is to move the text far outside the browser window by setting a large negative text-indent.

Using Absolute Positioning is known as _________
  • a)
    The Langridge method
  • b)
    The Levin Technique
  • c)
    The Scott Kellum method
  • d)
    The Leon method
Correct answer is option 'B'. Can you explain this answer?

Aditya Shah answered
This method also requires an additional <span> element to work. But the <span> element is not wrapped around the text but used to position our image.

Which of the following property specifies the look and design of an outline?
  • a)
    outline-font
  • b)
    outline-style
  • c)
    outline-format
  • d)
    none of the mentioned
Correct answer is option 'B'. Can you explain this answer?

The outline-style CSS property is used to set the style of the outline of an element. An outline is a line that is drawn around elements, outside the border edge, to make the element stand out.

Using Small font-size is also known as _____
  • a)
    Lindsay method
  • b)
    Leon Dwyer method
  • c)
    Levin technique
  • d)
    Radu Darvas Shim
Correct answer is option 'A'. Can you explain this answer?

Aditya Shah answered
Using small font-size is known as Lindsay method. Another way to hide text is by making it very small and set its color to the background of the image. This works without affecting accessibility but we can also face SEO penalties because of tiny font size and camouflaged color.

Which of the following represents browsing with no stylesheets applied?
  • a)
    CSS OFF/Images ON
  • b)
    CSS OFF/Images OFF
  • c)
    CSS ON/Images OFF
  • d)
    CSS ON/Images ON
Correct answer is option 'A'. Can you explain this answer?

Aditya Shah answered
CSS OFF/Images ON represents browsing with no stylesheets being applied. Most of the techniques default to regular web text here which is not exactly a fail, but since images may still be turned on.

Chapter doubts & questions for CSS Basics - 2 - CSS for Beginners 2024 is part of Class 6 exam preparation. The chapters have been prepared according to the Class 6 exam syllabus. The Chapter doubts & questions, notes, tests & MCQs are made for Class 6 2024 Exam. Find important definitions, questions, notes, meanings, examples, exercises, MCQs and online tests here.

Chapter doubts & questions of CSS Basics - 2 - CSS for Beginners in English & Hindi are available as part of Class 6 exam. Download more important topics, notes, lectures and mock test series for Class 6 Exam by signing up for free.

CSS for Beginners

10 videos|41 docs|23 tests

Top Courses Class 6

Signup to see your scores go up within 7 days!

Study with 1000+ FREE Docs, Videos & Tests
10M+ students study on EduRev