JSFiddle - React, Tailwind, and code Playground
HTML
<body class="body-common-styles">
<div class="css-grid-container-common-styles">
<nav class="navbar navbar-expand-lg navbar-light bg-light css-grid-item-nav-div-common-styles">
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbar1" aria-controls="navbar1" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="index.html">CodingJedi</a>
<div class="collapse navbar-collapse justify-content-between" id="navbar1">
<ul class="navbar-nav">
<li class="nav-item active">
<a class="nav-link" href="index.html">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="widgets.html">About</a>
</li>
</ul>
</div>
</nav>
<div class="css-grid-item-info-div-common-styles"> <!-- this container item is also a container -->
<div class="css-grid-container-practice-create-div-common-styles"> <!-- this is a container -->
<p class="css-grid-item-practice-para1-div-common-styles"> P1. </p>
<p class="css-grid-item-practice-para2-div-common-styles"> P2. </p>
<p class="css-grid-item-practice-para3-div-common-styles"> P3. </p>
<button type="button" class="button-common-styles-normal css-grid-item-practice-button-div-common-styles"> P! </button>
<p class="css-grid-item-create-para1-div-common-styles"> P4</p>
<p...
CSS
button {
align-self: center;
justify-self: center;
}
.body-common-styles {
background: linear-gradient(45deg,#33b1f8 37%,#6e90f6 100%); /*syntax linear-gradient(direction, color1 limit, color2 limit)*/
color:white;
font-family: Helvetica;
line-height: 1;
}
.div-common-styles{
background-color:#0F2148;
}
.button-common-styles-normal{
/*background: radial-gradient(ellipse,#268ff4 5%,#4da3f8 95%); */
background-color: #4da3f8;
border:none;
color:white;
border-radius: 8px;
width:100px; /* sets the width of the content area to 200 px */
height: 40px;
box-sizing: border-box;
text-align: center;
padding-top: 10px;
padding-bottom: 10px;
}
.button-common-styles-normal:hover {
background-color: #268ff4;
}
.center-horizontally-common-styles {
display: block;
margin: auto auto;
}
.centre-vertical-common-styles {
position: fixed; /*Fixed positioning acts similarly to absolute positioning with a couple of differences.*/
left: 50%; /*creates a space equal to 50% from left creating effect of moving the element towards the center horizontally*/
top: 50%; /* creates a space equal to 50% from top creating effect of moving the element towards the center vertically*/
transform: translate(-50%, -50%);
}
.centre-button-vertical-common-styles {
position: absolute; /*An absolutely positioned element is positioned relative to the first parent element that has a position other than static applied to it. */
left: 50%; /*creates a space equal to 50% from left creating effect of moving the element towards the center horizontally*/
top: 50%; /* creates a space equal to 50% from top creating effect of moving the element towards the center vertically*/
transform: translate(-50%, -50%);
}
.debug-border-common-styles {
border: 3px solid black;
height:200px;
width:400px;
}
.css-grid-container-common-styles{
height:100vh; /*???*/
display: grid;
...