Question: What is CSS?
Answer: CSS stands for Cascading Style Sheet. It is a style sheet language which is used to style HTML. CSS provides a graphical interface to HTML.

Question: Give some advantages of CSS.
Answer:

  • Code reusability
  • Ease in maintenance
  • Bandwidth Reduction
  • Every browser supports it.
  • Very fast and load pages faster.

Question: What is the file extension of CSS files?
Answer: We can store the CSS file using the .css extension.

Question: What are the different methods to integrate a CSS on an HTML page?
Answer: There are three ways by which we can integrate a CSS on HTML.

  • Inline method
  • The internal method or Embedded style
  • External method

Question: Why do we use the external method more than any other methods?
Answer: The external method increases the code reusability of CSS. In the external method, we create a CSS file and link it to the HTML page.

Question: What is Embedded style Sheet in CSS
Answer: When we write the CSS code in the HTML inside the style tag that method of applying CSS in an HTML page is known as Embedded style sheet.

For example

<style>
body {
background-color: yellow;
}
</style>

Question: Give some Advantages of Embedded style sheet in CSS.
Answer:

  • We can directly access specific HTML page CSS
  • The changes made on a style tag will remain for the same web page.

Question: What is the difference between inline and embedded style sheet?
Answer: Inline style writes along with the HTML tags and they style only a small piece of code.

For example

<h1 style="color:blue;margin-left:30px;">This is a heading</h1>

Whereas embedded style sheet can act on the whole web page and it is written between head tag for example:

<style>
body {
background-color: linen;
}
h1 {
color: red;
margin-left: 80px;
}
</style>

Question: Give some limitation of CSS.
Answer:

  • We cannot perform any logical operation
  • Unable to deal with Data Base
  • CSS cannot request a web page.

Question: Name Some frameworks of CSS
Answer:

  • Bootstrap
  • Foundation
  • Bulma
  • Ulkit
  • Semantic UI

Question: What is the framework?
Answer: A framework is a group of codes which call your code and perform a task.

Question: What are the components we keep in minds when we use CSS to style HTML?
Answer:

  • Selector
  • Property
  • Value

Question: What is a selector in CSS?
Answer: A selector is an HTML tag on which we want to perform the styling and the selector could be any tag such as <div>, <p>, etc.

Question: What are the type and universal selectors?
Answer: Whenever we want to style a tag first, we used to select it, when we select a specific type of tag that selection is known as type selection, for example, let’s perform a type selector on heading tag

h2 {
color: blue;
}

The above code goanna turns the colour blue of that text having the tag h2 and rest the colour of the tag remain black by default.

In universal selector instead of selecting a specific tag, we perform styling on every tag which satisfies the css statement. To perform the universal selector, we use the asterisk symbol.

* {
color: blue;
}

Question: What is Descendant selector in CSS?

Answer: In CSS when we use a tag inside another tag and only want to style those nested tag, we use the descendant selector. For example, here we only want to colour blue those emphasize tags which are inside the ordered list tags.

ol em {
color: blue;
}

Question: What is class selectors in CSS?

Answer: Class is an HTML attribute, and to perform styling on those class we use class selector and to select that a specific class we use the class name. In class selector instead of selecting a tag, we select a class attribute.

For example.

.classname
{              color : red;
}

Question: What is property in CSS?
Answer: A property is defined as a type of style perform on the selector and the properties are color, border, etc.

Question: What is value in CSS?
Answer: The data or values assigned to the properties is known as value and the values are red, blue or any color or any px value to the border.

Question: What is opacity in CSS?
Answer: Opacity is a property in CSS which is used to alter the transparency level of an object, especially it is used with the images.

For example:

<style>
img {
opacity: 0.4;
}
</style>

Question: What % unit signify in CSS value?
Answer: % measure the value in percentage.

For example

p {
line-size : 200 % ;
}

Question: What does cm mean in CSS value?
Answer: cm measures the values in centimetres

div {
margin-bottom: 5cm;
}

Question: Is CSS case sensitive?
Answer: No CSS is not case Sensitive

Question: Name the format in which we can specify the color in CSS
Answer:

  • Hex code
  • Short Hex Code
  • RGB %
  • RGB absolute
  • Keyword

Question: What is a Declaration box in CSS?
Answer: A declaration box is a block of statements inside the curly braces and those statements could be properties and values.

Question: Name the font attributes we use in CSS.
Answer:

  • font-style
  • font-variant
  • font-weight
  • font-size/ line -height
  • font-family
  • caption
  • icon

Question: What CSS property we use to color the background of a web page?

Answer: We use background-color

For <style>
body{
background-color: red;
}
</style>  example:

Question: Name all the positions where we can set an image CSS
Answer:

  • bottom
  • center
  • left
  • right
  • top

Question: What is Responsive Web Design?
Answer: Responsive web design aka RWD is a method of creating a webpage which can make a perfect display on every platform such as tablets, desktop, mobiles, and laptops. So we do not have to create web-pages for different devices and the display of web page automatically change according to the display size of the device.

Question: What is pseudo-element in CSS?
Answer: Pseudo-element is a concept in CSS which is used to style a specific part of a selector for example if we want to style the first line of a paragraph only.

p::first-line {
color: red;
}

Question: What is a float property in CSS?
Answer: A float property in CSS allows an element to float inside the parent body.

Question: Which CSS property is used to control the repetition of an image in the background?
Answer: To control the repetition of an image we use the background-repeat property

Question: What is the difference between visibility: hidden and display: none?
Answer: If we use visibility: hidden to hide an element it will hide that element with the blank spaces, it means that there would be a certain number of spaces that much text we wanted to hide.

But when we use the display: none it simply hides the element and occupies no spaces

Question: What is tweening?
Answer: It is a method of creating intermediate frames between two images.

Question: What is the navigation bar in CSS?
Answer: The navigation bar provides a dynamic user interface web page.

Question: What are the important declarations in CSS?
Answer: We use an important declaration to override the declaration having less importance.

Question: What is the CSS box Model and name its elements?
Answer: A box model deal with the design and layout of the elements and these elements are:

  • Margin
  • Border
  • Padding
  • Content

Question: What @import does in CSS?
Answer: @import is used to import one CSS file to another CSS file

For example

@import "another.css"

Question: Where we use the @import?
Answer: We use @import at the top to avoid the overriding of code.

Question: What are comments in CSS and we use it?
Answer: The comment is the special statements in CSS which do not execute to write a comment we use /* comment */

Question: Which Property is used to color a border?
Answer: border-color

You Might be Interested In:

Leave a Reply

Your email address will not be published. Required fields are marked *