5 Tricks For Frontend Developer
5 Tricks For Frontend Developer
Datalist element
Writing mode
Calc() function
Datalist element -
<label for="food">food</label>
<datalist id="dwr-list">
<option value="Pizza">
<option value="burger">
<option value="coffee">
<option value="tea">
<option value="fruits">
</datalist>
=============================================================================================
Writing mode - In CSS (Cascading Style Sheets), there are several different writing modes that
determine the direction and layout of text on a web page. Writing modes define the flow of
text, such as whether it should be displayed horizontally from left to right (LTR), right to left
(RTL), vertically from top to bottom (TB), or in a mixture of these directions.
1. Horizontal (LTR/RTL):
This is the default writing mode in CSS and is used for most web pages.
In this mode, text flows horizontally from left to right (LTR) for languages such as English,
and right to left (RTL) for languages such as Arabic or Hebrew.
Property -
writing-mode: horizontal-tb;
2. Vertical (TB):
3. Mixed (TB-RL/LR):
This writing mode combines both horizontal and vertical writing modes.
The text flows vertically from top to bottom, but individual lines are read from right to left (TB-RL) or
left to right (TB-LR).
For TB-RL ⟶
.container {
writing-mode: vertical-rl;
text-orientation: upright;
For TB-LR ⟶
.container {
writing-mode: vertical-rl;
text-orientation: sideways-right;
}
4. Sideways (TB):
In this writing mode, text is rotated 90 degrees and flows from top to bottom in a
sideways orientation.
For Sideways RL ⟶
writing-mode: sideways-rl;
For Sideways LR ⟶
writing-mode: sideways-lr;
These are the main writing modes available in CSS, which allow you to control the direction
and layout of text on your web pages according to the requirements of different languages
and writing systems.
=============================================================================================
The inset shorthand property in CSS is used to specify the values for the top, right, bottom, and
left properties in a single declaration.
Syntax ---
Example ⟶
.container {
=============================================================================================
Calc() function -
The calc() function is a CSS (Cascading Style Sheets) function that allows you to perform
mathematical calculations within a CSS property value.
Used to set dynamic values for properties such as width, height, margin, padding, and
other numeric values in CSS.
syntax ⟶
calc(expression)
expression is a mathematical expression that can include numbers, operators, and CSS units.
+: Addition
-: Subtraction
*: Multiplication
/: Division
Examples ----
.container {
.child {
.container {
width: 400px;
.para {
font-size: 18px;
=============================================================================================
Hiding an HTML element -
visibility: hidden;
display: none;
HTML Attribute
Type="hidden" attribute