Based on the latest data from Seek.com.au in 2019 proficient experience with CSS and HTML is listed for 95% of all web development job descriptions. Come along and check the list of top most advanced CSS interview questions and answers for full stack and experienced web developers.
floats and how they workFloat is a CSS positioning property. Floated elements remain a part of the flow of the web page. This is distinctly different than page elements that use absolute positioning. Absolutely positioned page elements are removed from the flow of the webpage.
#sidebar {
float: right; // left right none inherit
}The CSS clear property can be used to be positioned below left/right/both floated elements.
Flexbox or Grid specs?Yes. Flexbox is mainly meant for 1-dimensional layouts while Grid is meant for 2-dimensional layouts.
Flexbox solves many common problems in CSS, such as vertical centering of elements within a container, sticky footer, etc. Bootstrap and Bulma are based on Flexbox, and it is probably the recommended way to create layouts these days. Have tried Flexbox before but ran into some browser incompatibility issues (Safari) in using flex-grow, and I had to rewrite my code using inline-blocks and math to calculate the widths in percentages, it wasn't a nice experience.
Grid is by far the most intuitive approach for creating grid-based layouts (it better be!) but browser support is not wide at the moment.
pseudo-elements and discuss what they are used forA CSS pseudo-element is a keyword added to a selector that lets you style a specific part of the selected element(s). They can be used for decoration (:first-line, :first-letter) or adding elements to the markup (combined with content: ...) without having to modify the markup (:before, :after).
Example of usage:
:first-line and :first-letter can be used to decorate text..clearfix hack to add a zero-space element with clear: both.:before and :after. Encourages separation of concerns because the triangle is considered part of styling and not really the DOM, but not really possible to draw a triangle with just CSS styles.table-layout propertyThe table-layout property defines the algorithm used to lay out table cells, rows, and columns.
table-layout: auto|fixed|initial|inherit;When a browser displays a document, it must combine the document's content with its style information. It processes the document in two stages:
Both responsive and adaptive design attempt to optimize the user experience across different devices, adjusting for different viewport sizes, resolutions, usage contexts, control mechanisms, and so on.
Responsive design works on the principle of flexibility — a single fluid website that can look good on any device. Responsive websites use media queries, flexible grids, and responsive images to create a user experience that flexes and changes based on a multitude of factors. Like a single ball growing or shrinking to fit through several different hoops.
Adaptive design is more like the modern definition of progressive enhancement. Instead of one flexible design, adaptive design detects the device and other features, and then provides the appropriate feature and layout based on a predefined set of viewport sizes and other characteristics. The site detects the type of device used, and delivers the pre-set layout for that device. Instead of a single ball going through several different-sized hoops, you’d have several different balls to use depending on the hoop size.
Accessibility (a11y) is a measure of a computer system's accessibility is to all people, including those with disabilities or impairments. It concerns both software and hardware and how they are configured in order to enable a disabled or impaired person to use that computer system successfully.
Accessibility is also known as assistive technology.
A Mixin is a block of code that lets us group CSS declarations we may reuse throughout our site.
To define mixin:
@mixin grid($flex: true /*default argument*/) {
@if $flex {
@include flex;
} @else {
display: block;
}
}To use a Mixin, we simply use @include followed by the name of the Mixin and a semi-colon.
/*scss*/
.row {
@include grid(true);
}
/*css*/
.row {
display: -webkit-flex;
display: flex;
}There are two syntaxes available for Sass. The first, known as SCSS (Sassy CSS) and used throughout this reference, is an extension of the syntax of CSS. This means that every valid CSS stylesheet is a valid SCSS file with the same meaning. This syntax is enhanced with the Sass features described below. Files using this syntax have the .scss extension.
The second and older syntax, known as the indented syntax (or sometimes just Sass), provides a more concise way of writing CSS. It uses indentation rather than brackets to indicate nesting of selectors, and newlines rather than semicolons to separate properties. Files using this syntax have the .sass extension.
Consider example.sass:
$color: red
=my-border($color)
border: 1px solid $color
body
background: $color
+my-border(green)Consider example.scss:
$color: red;
@mixin my-border($color) {
border: 1px solid $color;
}
body {
background: $color;
@include my-border(green);
}relative, fixed, absolute and statically positioned element?A positioned element is an element whose computed position property is either relative, absolute, fixed or sticky.
static - The default position; the element will flow into the page as it normally would. The top, right, bottom, left and z-index properties do not apply.relative - The element's position is adjusted relative to itself, without changing layout (and thus leaving a gap for the element where it would have been had it not been positioned).absolute - The element is removed from the flow of the page and positioned at a specified position relative to its closest positioned ancestor if any, or otherwise relative to the initial containing block. Absolutely positioned boxes can have margins, and they do not collapse with any other margins. These elements do not affect the position of other elements.fixed - The element is removed from the flow of the page and positioned at a specified position relative to the viewport and doesn't move when scrolled.sticky - Sticky positioning is a hybrid of relative and fixed positioning. The element is treated as relative positioned until it crosses a specified threshold, at which point it is treated as fixed positioned.translate() instead of absolute positioning, or vice-versa? And why?clearfix methods do you know? Provide some examples..zip, .ZIP, .Zip etc...Rust has been Stack Overflow’s most loved language for four years in a row and emerged as a compelling language choice for both backend and system developers, offering a unique combination of memory safety, performance, concurrency without Data races...
Clean Architecture provides a clear and modular structure for building software systems, separating business rules from implementation details. It promotes maintainability by allowing for easier updates and changes to specific components without affe...
Azure Service Bus is a crucial component for Azure cloud developers as it provides reliable and scalable messaging capabilities. It enables decoupled communication between different components of a distributed system, promoting flexibility and resili...