Fixing a div to the right of a page
How do I make an fixing a div to the right of a page?
This is an example from the blog article The complete guide to fixed divs at http://www.tipue.com/blog/fixed-divs/. What is a fixing a div to the right of a page? How do you make a fixing a div to the right of a page? This script and codes were developed by Steve Pear on 16 September 2022, Friday.
Fixing a div to the right of a page - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Fixing a div to the right of a page</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="fixed-div"><h1>Fixed div</h1></div><div class="text">Nonummy quis dolore ut in facilisis ex veniam ut euismod consequat adipiscing wisi, elit euismod tation nonummy duis, exerci nisl te. Iriure qui feugiat iusto iriure exerci commodo illum, consequat dolor vel vel luptatum, amet et ullamcorper ad ut. Tincidunt feugait erat at tincidunt, odio molestie feugiat delenit illum ad ex, te eum dolore, nisl wisi. Blandit esse zzril dolor, erat sit diam vulputate adipiscing ex vulputate, ullamcorper. Ea suscipit, et, vel eros, et minim feugiat, esse aliquip autem ipsum commodo dignissim lorem, eros quis et duis iusto, augue, dolore eu diam et in. Duis nisl esse eum lobortis ea consequat duis luptatum aliquam quis.</div>
</body>
</html>
Fixing a div to the right of a page - Script Codes CSS Codes
body
{ height: 900px; font: 16px/1.6 "Open Sans", sans-serif;
}
h1
{ font: 18px/1.6 "Open Sans", sans-serif; color: #333; text-transform: uppercase; letter-spacing: 2px;
}
.text
{ padding: 10px 100px;
}
.fixed-div
{ position: fixed; top: 70px; right: 20px; width: 120px; padding: 10px 30px; text-align: center; background-color: #fff; border: 1px solid #e2e2e2;
}
![Fixing a div to the right of a page - Script Codes](http://shots.codepen.io/Tipue/pen/dADJK-512.jpg)
Developer | Steve Pear |
Username | Tipue |
Uploaded | September 16, 2022 |
Rating | 3 |
Size | 1,962 Kb |
Views | 38,456 |
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 |
Images and vw width | 1,488 Kb |
Centering a div at the bottom of a page | 1,586 Kb |
Centering a div within a div, horizontally and vertically | 1,584 Kb |
Flexbox, div centered | 1,628 Kb |
Fixing a div to the center of the viewport, CSS3 style | 2,612 Kb |
Fixing a div to the horizontal center of a page | 1,984 Kb |
Centering a div within a div, old-school | 1,575 Kb |
Fixing a div, basic | 2,004 Kb |
A Flexbox example, basic | 1,572 Kb |
Flexbox, big third, third gone | 1,777 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 |
CSS-Flexbox-Demo | Sstiglets | 1,709 Kb |
Animated rainbow wave on canvas | Icodeforlove | 2,777 Kb |
Octopus Bar iPad App Interactions | Davidkpiano | 6,735 Kb |
Flex layout example | Mofny | 1,663 Kb |
Client-side Email Validation | Collizo4sky | 1,538 Kb |
A Pen by Alex Edwards | Exards | 8,218 Kb |
AOR site logo | Thatbram | 2,527 Kb |
Halo 5 REQ Guide Bookmarklet | Cwacht | 3,993 Kb |
Twitch | SarahDunlap | 2,937 Kb |
Greyscale image with filter in CSS3 | NickyCDK | 1,562 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!