UI interview Questions
UI interview Questions
HTML tags are like keywords which defines that how web browser will format and
display the content. With the help of tags, a web browser can distinguish between
an HTML content and a simple content. HTML tags contain three main parts: opening
tag, content and closing tag. But some HTML tags are unclosed tags.
When a web browser reads an HTML document, browser reads it from top to bottom and
left to right. HTML tags are used to create HTML documents and render their
properties. Each HTML tags have different properties.
HTML attributes are special words which provide additional information about the
elements or attributes are the modifier of the HTML element.
Each element or tag can have attributes, which defines the behaviour of that
element.
Attributes should always be applied with start tag.
The Attribute should always be applied with its name and value pair.
The Attributes name and values are case sensitive, and it is recommended by W3C
that it should be written in Lowercase only.
You can add multiple attributes in one HTML element, but need to give space between
two attributes.
HTML Lists are used to specify lists of information. All lists may contain one or
more list elements. There are three different types of HTML lists:
In the ordered HTML lists, all the list items are marked with numbers by default.
It is known as numbered list also. The ordered list starts with <ol> tag and the
list items start with <li> tag.
In HTML Unordered list, all the list items are marked with bullets. It is also
known as bulleted list also. The Unordered list starts with <ul> tag and list items
start with the <li> tag.
HTML Description list is also a list style which is supported by HTML and XHTML. It
is also known as definition list where entries are listed like a dictionary or
encyclopedia.
The definition list is very appropriate when you want to present glossary, list of
terms or other name-value list.
The HTML class attribute specifies one or more class names for an element
Classes are used by CSS and JavaScript to select and access specific elements
The class attribute can be used on any HTML element
The class name is case sensitive
Different HTML elements can point to the same class name
JavaScript can access elements with a specific class name with the
getElementsByClassName() method
When the content of one completely different webpage is embedded into another
webpage, it is called a nested webpage. In simple words, a webpage that is inside
another webpage of a completely different domain.
Table of Content
To include an external JavaScript file, we can use the script tag with the
attribute src . You've already used the src attribute when using images. The value
for the src attribute should be the path to your JavaScript file. This script tag
should be included between the <head> tags in your HTML document.
The CSS position property defines the position of an element in a document. This
property works with the left, right, top, bottom and z-index properties to
determine the final position of an element on a page.
There are five values the position property can take. They are:
static
relative
absolute
fixed
sticky
Static
This is the default value for elements. The element is positioned according to the
normal flow of the document. The left, right, top, bottom and z-index properties do
not affect an element with position: static.
Let's use an example to show that position: static has no effect on the position of
an element. We have three divs placed in a parent container. We'll use this example
throughout this article.
Relative
Elements with position: relative remain in the normal flow of the document. But,
unlike static elements, the left, right, top, bottom and z-index properties affect
the position of the element. An offset, based on the values of left, right, top and
bottom properties, is applied to the element relative to itself.
Absolute
Elements with position: absolute are positioned relative to their parent elements.
In this case, the element is removed from the normal document flow. The other
elements will behave as if that element is not in the document. No space is created
for the element in the page layout. The values of left, top, bottom and right
determine the final position of the element.
Fixed
Fixed position elements are similar to absolutely positioned elements. They are
also removed from the normal flow of the document. But unlike absolutely positioned
element, they are always positioned relative to the <html> element.
Sticky
position: sticky is a mix of position: relative and position: fixed. It acts like a
relatively positioned element until a certain scroll point and then it acts like a
fixed element. Have no fear if you don't understand what this means, the example
will help you to understand it better.
मराठी मध्ये
In English
CSS may be added to HTML in three different ways. To style a single HTML element on
the page, use Inline CSS in a style attribute. By adding CSS to the head section of
our HTML document, we can embed an internal stylesheet. We can also connect to an
external stylesheet that separates our CSS from our HTML.
To test a website in multiple browsers using LambdaTest, sign up or log in, select
browsers and platforms, upload your website or provide a URL, choose test
configurations, run the tests, review results for screenshots and videos, debug and
fix issues, and retest if needed after making fixes.
Grid is a collection of rows and columns along with margins, and spacing between
each row and column. A designer can always tweak the number of rows or columns
required and also the margin and spacing between each of these rows and columns.
The optimal use of grids serves as a guiding layout for overall designs. It helps
to create consistent templates and standards. Using baselines (columns and rows)
and padding( gutters and margins) it becomes easy to configure multiple screens at
once. Grid ensures a balanced hierarchy of screen elements. Grid systems have
different types of grids(which we’ll have a look at later in this article).
These were some basic terminologies a designer should know before using a grid
system. One thing to keep in mind is that “Elements don’t need to end at the same
marking but all elements should start at the same marking” when using a grid
system.
1. Symmetrical Grids: This types of grid system in UI Design are evenly spread,
which means all the elements are aligned with the center. Such grid systems consist
of an equal number of rows and columns. These look very pleasing to the eye and
elements are evenly spread on the screen. Give a formal and clean look to the
designs.
Column Grid: The most commonly used grid type, where a frame is split into multiple
columns separated with gutters. It is pleasing to the eye and creates a balanced
visual hierarchy. Screen elements like text, images, and buttons are aligned using
these columns. Column grids are mostly used in magazines and newspapers. Margins
are fixed and independently sized.
Column Grid
Column Grid
Pixel grid: It is a type of symmetrical grid, where the layout is fixed having
columns and rows that make it appear like a grid cage. It feels like one has super
zoomed into Figma or just like our math elementary notebook. This grid type helps
in creating pixel-perfect designs, each box denotes a pixel itself. Designers
occasionally close in to make pixel-by-pixel adjustments to the millions of pixels
that make up digital screens.
Pixel Grid
Pixel Grid
Baseline grid: It is also a type of symmetrical grid, where the layout is fixed
having only horizontal lines as a guide, a ruled notebook is a straightforward
illustration of a baseline grid. To make sure that the lines of text in each column
align consistently across a spread, baseline grids are frequently used in
conjunction with column grids.
Baseline Grid
These are some popular types of grids that are used based on different requirements
and needs. It is good to know about each of these so that as a designer one can
utilize and leverage the best guiding layout grid system.
To know the optimal usage of a grid system, knowing how to use the grid is very
important. As a beginner using a grid can be very overwhelming and confusing but
not to worry, We’re here to rescue you. Now let’s look into how to use the grid to
create an organized and consistent layout.
There are a few frameworks that are already defined to use grid systems optimally.
Such as 12 cols, 6 cols, 4 cols, and 3 colors even 2 and 1 col grids, here
12,6,4,3,2, and 1 are the number of grids in which the screen is divided. But not
only this can be used, but there might also be a screen that requires an 8-col grid
and it is completely okay to use a customized grid that suits the need. Not only
grids but keep in mind the screens as well, using the same grids for multiple
devices might not be a good option.
2. Take care of text alignment: Make sure that all the text irrespective of the
font weight and size, everything should be placed on a fixed baseline. This is a
part of the layout as well and maintaining a grid layout along with text hierarchy
would make the content and website/app appear more pleasing to the eyes.
3. Emphasize breaking the grid: It is a rule that says while using a grid it is
mandatory to place all elements inside the grid boundary but nowadays it is more
popular to break the grid to emphasize certain elements. When something is out of
alignment or disturbing the layout it gets noticed easily, a similar trend is
getting by breaking grid boundaries.
4. Maintain gutter balance: Equally, pay attention to both vertical and horizontal
grid alignments. For example, if you are using a gutter of 20px between 2 vertical
columns keep the same gutter between horizontal rows as well. Doing this would make
the content on the screen very well organized even if not symmetric.
5. Use 8pt grid: Using baseline numbers and their multiple promotes layout to fit
as per screen sizes. Such as the 8pt grid, which is the most popular. An 8pt grid
is currently widely used because it allows designs to grow well on retina screens
like iPhones and TV screens and works with both vector and pixel-based graphics.
6. Know where to start: Always remember to place the content on the screen using
the grid as a guideline, start with a grid, not with the gutter. Keep content
aligned with the start and end of a column’s edge, module, or pixel. This might not
sound critical from a design perspective but it is very helpful to guide a
developer on how and where to place media content like images and video. As
developers also do follow the grid system which codes your designs.
7. Use grid generators: There are good options available online for generating a
grid based on the screen sizes. This can be very useful for the times when you are
just starting with visual designs. Using them speeds up the process and ensures the
layout is optimized for use.
1. Bootstrap
2. Tailwind CSS
3. Foundation
4. Bulma
5. Skeleton
6. UIkit
7. Milligram
It provides code re usability because single JavaScript file can be used in several
html pages.
The purpose of jQuery is to make it much easier to use JavaScript on your website.
jQuery takes a lot of common tasks that require many lines of JavaScript code to
accomplish, and wraps them into methods that you can call with a single line of
code.
jQuery also simplifies a lot of the complicated things from JavaScript, like AJAX
calls and DOM manipulation.
HTML/DOM manipulation
CSS manipulation
HTML event methods
Effects and animations
AJAX
Utilities
In this article, we will learn how to read, write and delete cookies in jQuery.
This can be done using the cookie() and removeCookie() methods of the jquery-cookie
library. We will first understand what exactly is a cookie.
Cookie: Cookies are small blocks of data created by a web server when a user is
using a website and cookies are stored on the user’s device. These cookies remember
certain information about the user.
1. Creating or writing a cookie: We use the cookie() method to create cookies.
Syntax:
Syntax:
$.cookie('name');
Parameters: It has a single parameter, which is the name of the cookie to be read.
Syntax:
$.removeCookie('name');
Parameters: It has a single parameter, which is the name of the cookie.
Return Value: It Returns true when a cookie was successfully deleted, otherwise, it
returns false.
val() method is primarily used to get the values of form elements such as input ,
select and textarea . When called on an empty collection, it returns undefined .
The html() method sets or returns the content (innerHTML) of the selected elements.
When this method is used to return content, it returns the content of the FIRST
matched element. When this method is used to set content, it overwrites the content
of ALL matched elements.
HTML/DOM manipulation.
CSS manipulation.
HTML event methods.
Effects and animations.
AJAX.
Utilities.