Auto margin positioning
How do I make an auto margin positioning?
A pen showing what can be done when using auto margins. Pretty much useless nowadays with Flexbox though.. What is a auto margin positioning? How do you make a auto margin positioning? This script and codes were developed by Anthony Koch on 06 November 2022, Sunday.
Auto margin positioning - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Auto margin positioning</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="wrapper"> <div class="box auto-left"> <span> Auto Left </span> </div> <div class="box auto-right"> <span> Auto Right </span> </div>
</div> <script src="js/index.js"></script>
</body>
</html>
Auto margin positioning - Script Codes CSS Codes
.wrapper { max-width: 900px; margin: 40px auto;
}
.box { background: rgba(255, 0, 0, 0.7); height: 100px; max-width: 200px; position: relative;
}
.box > span { font-family: Verdana; color: white; position: absolute; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);
}
.auto-left { margin-left: auto;
}
.auto-right { margin-right: auto;
}
Auto margin positioning - Script Codes JS Codes
/* Sort of a cool thing, but useless now that flexbox is around. */
"use strict";
Developer | Anthony Koch |
Username | anthonykoch |
Uploaded | November 06, 2022 |
Rating | 3 |
Size | 2,403 Kb |
Views | 14,168 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Testing nth-child | 4,608 Kb |
Calculator | 21,683 Kb |
Settings Page | 16,757 Kb |
Wordpress Admin Redesign | 11,947 Kb |
Testing upcoming height values | 3,073 Kb |
Single occurence | 2,503 Kb |
Discord login page | 4,180 Kb |
The difference between text centering and container centering | 2,782 Kb |
Social Connect | 5,540 Kb |
Smart Home UI | 7,569 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Gradient-ui-button-mark-fx | Tabspace | 1,881 Kb |
Project -Show the Local Weather | Luciano_Britis | 2,583 Kb |
Pure CSS Spinners | Jlong | 2,043 Kb |
PNotify Demo | Adittmar | 1,731 Kb |
Rain Landing in a Pond | Edball | 3,009 Kb |
Right Click Menu | Anodpixels | 2,252 Kb |
CSS Chat Bubbles | Boylett | 2,094 Kb |
Falling Down the Rabbit Hole | Rachelnabors | 4,578 Kb |
Feedback Page | TessDiNapoli | 2,836 Kb |
Draggables in pure angular | Rlo206 | 5,167 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!