Automatic Quotes
How do I make an automatic quotes?
Automatically insert pullquotes / blockquotes with a small bit of jQuery and the data-attribute selector.. What is a automatic quotes? How do you make a automatic quotes? This script and codes were developed by Luke Watts on 14 August 2022, Sunday.
Automatic Quotes - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Automatic Quotes</title> <script src="http://s.codepen.io/assets/libs/modernizr.js" type="text/javascript"></script> <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="container"> <h1>Automatic Quotes</h1> <p>This is a test on a simple way to use the data-attribute to deligate a snippet of text to quickly and easily use as a blockquote or pullquote.<p> <p>This is a nice way to keep your HTML a bit more DRY. <span data-quote>DRY! DRY! DRY!</span> Boy it's late! It's like 4am. Why am I still awake? Surely I could've waited and done this in the morning.</p> <p>Anyways, there's two ways to achive this. Version 1: You can simply clone the 'span[data-quote]' element and add a class and then append or prepend it to the nth-child. Version 2 uses wrapInner() to create a blockquote around the text.</p> <p>You could go even further and create an extensive selection of attributes: data-blockquote, data-pullquote, data-left-quote, data-right-quote etc. Once you're css is right you could have unlimited options with ease.<p>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Automatic Quotes - Script Codes CSS Codes
@import url(http://fonts.googleapis.com/css?family=Cinzel+Decorative:900);
@import url(http://fonts.googleapis.com/css?family=Gudea);
*,
*::before,
*::after { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;
}
body { background-color: #4da2b3;
}
.container { margin: 0 auto; max-width: 40em; text-align: justify;
}
h1 { font-family: "Cinzel Decorative",Georgia, serif; font-size: 4em; text-align: center;
}
p { font-family: "Gudea", sans-serif;
}
.quote { font-family: Georgia, serif; font-size: 2em; font-style: italic; color: white; float: left; text-align: right; margin-right: 0.5em; max-width: 9.5em; padding: 0.5em;
}
.quote::before { content: "\201C";
}
.quote::after { content: "\201D";
}
Automatic Quotes - Script Codes JS Codes
$(document).ready(function() { // Version 1 $('span[data-quote]').clone().prependTo('p:nth-child(3)').addClass('quote'); // Version 2 /** * More specific slection using 'nth' pseudo * selector * Use wrapInner() to wrap the textnode in a * traditional blockquote */ /*$('span[data-quote]').clone().prependTo('p:nth-child(2)').wrapInner('<blockquote />');*/
});
Developer | Luke Watts |
Username | lukewatts |
Uploaded | August 14, 2022 |
Rating | 3 |
Size | 3,216 Kb |
Views | 34,408 |
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 |
Media Module Pattern | 2,823 Kb |
Footer Concept 02 | 10,469 Kb |
SmartQRTravel Login Form | 4,102 Kb |
Justified Fullsizable Gallery | 3,131 Kb |
Form Inputs | 3,504 Kb |
Custom Google Maps | 5,076 Kb |
Before and After Image Slider | 2,747 Kb |
Affinity4 SVG Logo Animation | 2,729 Kb |
Webkit Background Text Clip | 2,808 Kb |
CSS Drop Shadows with Global Illumination | 2,559 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 Letter animations | Sladix | 2,116 Kb |
Blog demo to use given styling | Andygirl | 2,412 Kb |
Front in Aracaju Logo Pure CSS | Shankarcabus | 2,581 Kb |
Parallax.js | Zmeeey5 | 2,330 Kb |
Portfolio Layout Flex | Lahvjal | 3,489 Kb |
Update CSS Variables with JS | Wesbos | 2,335 Kb |
Awesome Full Page Menu Nav | Ey_intuitive | 4,194 Kb |
Adding and Removing Element | Accimeesterlin | 2,119 Kb |
Fun form with currentColor | Bnthor | 2,713 Kb |
Super Discount | Orrinward | 3,225 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!