Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Questions | Answers | Discussions | Knowledge sharing | Communities & more.
How case-sensitive is CSS?
All CSS style sheets are case-insensitive, except for portions that are not under the control of CSS. For example, the case sensitivity due to values of the HTML attributes "id" and "class", font names, and URIs lies outside the scope of this specification.
All CSS style sheets are case-insensitive, except for portions that are not under the control of CSS. For example, the case sensitivity due to values of the HTML attributes “id” and “class”, font names, and URIs lies outside the scope of this specification.
See lessWhat is the best way to include a CSS file? Why use @import?
The External Style Sheet (using HTML Tag) is the best method that is used to link the element. Maintaining and re-using the CSS file across different pages is easy and efficient. The tag is placed in the HTML element. To specify a media type="text/css” for a Cascading Style Sheet attribute which isRead more
The External Style Sheet (using HTML Tag) is the best method that is used to link the element. Maintaining and re-using the CSS file across different pages is easy and efficient. The tag is placed in the HTML element. To specify a media type=”text/css” for a Cascading Style Sheet attribute which is used to ignore style sheet types that are not supported in a browser.
@import rule: The @import rule is used to import one style sheet into another style sheet. This rule also supports media queries so that the user can import the media-dependent style sheet. The @import rule must be declared at the top of the document after any @charset declaration.
Characteristics of @import:
The @import at-rule is used to import a style sheet into an HTML page or another style sheet.
The @import at-rule is also used to add media queries, therefore import is media-dependent.
It is always to be declared at the top of the document.
Syntax:
See less@import url|string list-of-mediaqueries;
What is CSS flexbox?
It is also called a flexible box model. It is basically a layout model that provides an easy and clean way to arrange items within a container. Flexbox is different from the block model which is vertically biased and the inline which is horizontally biased. Flexbox was created for small-scale layoutRead more
It is also called a flexible box model. It is basically a layout model that provides an easy and clean way to arrange items within a container. Flexbox is different from the block model which is vertically biased and the inline which is horizontally biased. Flexbox was created for small-scale layouts and there’s another standard called grids which are geared more towards larger-scale layouts, It works similar to the way to Twitter bootstrap grid system works. Flexbox is responsive and mobile-friendly. To start with flexbox firstly create a flex container. To create a flex container set the display property to flex.
Syntax:
.main-container {
display: flex;
}
Flex Properties:
flex-direction
See lessflex-wrap
flex-flow
justify-content
align-items
align-content
How can we make our website responsive using CSS?
Media query is used to create a responsive web design. It means that the view of a web page differs from system to system based on screen or media types. Media queries can be used to check many things: width and height of the viewport width and height of the device Orientation Resolution A media queRead more
Media query is used to create a responsive web design. It means that the view of a web page differs from system to system based on screen or media types.
Media queries can be used to check many things:
width and height of the viewport
width and height of the device
Orientation
Resolution
A media query consist of a media type that can contain one or more expression which can be either true or false. The result of the query is true if the specified media matches the type of device the document is displayed on. If the media query is true then a style sheet is applied.
Syntax:
See less@media not | only mediatype and (expression) {
// Code content
}
What does the CSS box-sizing property do?
The box-sizing CSS property defines how the user should calculate the total width and height of an element i.e. padding and borders, are to be included or not. Syntax: box-sizing: content-box|border-box; Property Values: content-box: This is the default value of the box-sizing property. In this modeRead more
The box-sizing CSS property defines how the user should calculate the total width and height of an element i.e. padding and borders, are to be included or not.
Syntax:
box-sizing: content-box|border-box;
Property Values:
content-box: This is the default value of the box-sizing property. In this mode, the width and height properties include only the content. Border and padding are not included in it i.e if we set an element’s width to 200 pixels, then the element’s content box will be 200 pixels wide, and the width of any border or padding will be added to the final rendered width.
See lessborder-box: In this mode, the width and height properties include content, padding, and borders i.e if we set an element’s width to 200 pixels, that 200 pixels will include any border or padding we added, and the content box will shrink to absorb that extra width. This typically makes it much easier to size elements.
How can we animate using CSS?
CSS Animations is a technique to change the appearance and behavior of various elements in web pages. It is used to control the elements by changing their motions or display. It has two parts, one which contains the CSS properties which describe the animation of the elements and the other contains cRead more
CSS Animations is a technique to change the appearance and behavior of various elements in web pages. It is used to control the elements by changing their motions or display. It has two parts, one which contains the CSS properties which describe the animation of the elements and the other contains certain keyframes which indicate the animation properties of the element and the specific time intervals at which those have to occur.
The @keyframes rule: Keyframes are the foundations with the help of which CSS Animations works. They define the display of the animation at the respective stages of its whole duration. For example: In the following code, the paragraph changes its color with time. At 0% completion, it is red, at 50% completion it is of orange color and at full completion i.e. at 100%, it is brown.
See lessCan we add 3D transformations to our project using CSS?
Yes, it allows changing elements using 3D transformations. In 3D transformation, the elements are rotated along the X-axis, Y-axis, and Z-axis. There are three main types of transformation which are listed below: rotateX() rotateY() rotateZ()
Yes, it allows changing elements using 3D transformations. In 3D transformation, the elements are rotated along the X-axis, Y-axis, and Z-axis.
There are three main types of transformation which are listed below:
rotateX()
See lessrotateY()
rotateZ()
Can we add 2D transformations to our project using CSS?
Yes, we can, a transformation modifies an element by its shape, size, and position. It transforms the elements along the X-axis and Y-axis. There are six main types of 2D transformations which are listed below: translate() rotate() scale() skewX() skewY() matrix()
Yes, we can, a transformation modifies an element by its shape, size, and position. It transforms the elements along the X-axis and Y-axis.
There are six main types of 2D transformations which are listed below:
translate()
See lessrotate()
scale()
skewX()
skewY()
matrix()
How can we add gradients in CSS?
Linear Gradients: It includes the smooth color transitions to going up, down, left, right, and diagonally. A minimum of two colors are required to create a linear gradient. More than two color elements can be possible in linear gradients. The starting point and the direction are needed for the gradiRead more
Linear Gradients: It includes the smooth color transitions to going up, down, left, right, and diagonally. A minimum of two colors are required to create a linear gradient. More than two color elements can be possible in linear gradients. The starting point and the direction are needed for the gradient effect.
Syntax:
background-image: linear-gradient(direction, color-stop1, color-stop2, …);
2. CSS Radial Gradients: A radial gradient differs from a linear gradient. It starts at a single point and emanates outward. By default, the first color starts at the center position of the element and then fades to the end color towards the edge of the element. Fade happens at an equal rate until specified.
Syntax:
See lessbackground-image: radial-gradient(shape size at
What is the difference between display: none and visibility: hidden?
Both of the property is quite useful in CSS. The visibility: “hidden”; property is used to specify whether an element is visible or not in a web document but the hidden elements take up space in the web document. The visibility is a property in CSS that specifies the visibility behavior of an elemenRead more
Both of the property is quite useful in CSS. The visibility: “hidden”; property is used to specify whether an element is visible or not in a web document but the hidden elements take up space in the web document. The visibility is a property in CSS that specifies the visibility behavior of an element and display: “none” property is used to specify whether an element is exist or not on the website.
Syntax:
Visibility property:
visibility: visible| hidden | collapse | initial | inherit;
Display property:
See lessdisplay: none | inline | block | inline-block;
So, the difference between display: “none”; and visibility: “hidden”;, right from the name itself we can tell the difference as display: “none”, completely gets rids of the tag, as it had never existed in the HTML page whereas visibility: “hidden”;, just makes the tag invisible it will still be on the HTML page occupying space it’s just invisible.