HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
Any URLs added here will be added as <link>
s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
Any URL's added here will be added as <script>
s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
Search for and use JavaScript packages from npm here. By selecting a package, an import
statement will be added to the top of the JavaScript editor for this package.
Using packages here is powered by esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<b>Möchtest du mit Social Media Design authentischer wahrgenommen werden? </b></br><a href="https://buschmann.co/socialmedia" target="_blank"><font color="84bf40">https://buschmann.co/socialmedia</font></a>
</br>
/* no code here */
var words = {
"data": ["Stelle deiner Zielgruppe eine Frage", "Veröffentliche ein inspirierendes Zitat", "Die größten Mythen über dein Expertenthema", "Mach' ein Foto von deinem Arbeitsplatz", "Führe ein Interview mit einem Kunden", "Beschreibe deine persönliche Mission", "Welches Buch liest du derzeit?", "Welches Tool erleichtert dein Leben?", "Stelle andere Experten in deinem Netzwerk vor", "Teile einen interessanten Artikel", "Dein größtes Learning in diesem Jahr?", "Auf welchen Events kann man dich treffen?", "Erstelle eine Infografik zu deinem Expertenthema", "Hast du eine ungewöhnliche Angewohnheit?", "Was wissen deine Follower noch nicht über dich?", "Was unterscheidet dich von anderen Experten?", "An welchen Orten hast du die besten Ideen?", "Was motiviert dich jeden Tag?", "Was ist die Geschichte hinter deinem Logo?", "Welcher Traum ist für dich wahr geworden?", "Frage deine Zielgruppe nach ihren Herausforderungen", "Veröffentliche einen Beitrag, in dem sich andere vorstellen können","Welche/r Unternehmer/in inspiriert dich und warum?", "Womit kannst du die Probleme deiner Zielgruppe lösen?", "Stelle dich in einem kurzen Video vor","Dokumentiere deinen Tag – jede Stunde ein neues Foto", "Deine Follower dürfen dir eine Entscheidung abnehmen", "Starte eine Diskussion zu einem aktuellen Thema", "Teile einen Satz, den andere vervollständigen sollen", "Dein Geheimrezept für mehr Effektivität", "Was kannst du für deine Zielgruppe tun?", "Ein Blick hinter die Kulissen – wie arbeitest du?", "Was würdest du bei einem Neustart sofort anders machen?", "Frage nach Feedback zu deiner Webseite", "Teile eine provokante Ansicht, die nicht jedem gefällt", "Was begeistert dich an deinem Thema?", "Welche Denkfehler haben viele in deinem Bereich?", "Die Millionenfrage: welche Leistung von dir wäre so viel wert?", "Welches große Ziel möchtest du in den nächsten 3 Jahren erreichen?", "Wie lernst du mehr über dein Expertenthema?", "Welche 5 Fehler macht deine Zielgruppe?", "Dein glücklichster Moment als Unternehmer/in?", "Was sind deine Stärken?", "Womit bekommst du nach der Arbeit die Gedanken frei?", "Welche 3 Werte sind dir am wichtigsten & warum?", "Welche Geschichte hast du in diesem Monat erlebt?", "Lade deine Zielgruppe ein, mit dir zu telefonieren", "Teile eine persönliche Geschichte", "Teile eine Erfolgsgeschichte (deiner Kunden)", "Poste einen altes Foto, was hat sich seitdem verändert?", "Welches Lied beschreibt deine aktuelle Situation?", "Das erste Mal: probiere ein neues Format aus (Video/Live/Podcast usw...)"]
},
count = words.data.length,
b = document.getElementsByTagName("BODY")[0],
c = document.createElement('h1'),
e = document.createElement('p'),
d = document.createElement('p'),
bodyStyles = {
fontFamily : 'Roboto, sans-serif',
textAlign : 'center',
background : '#000000',
color : '#fff'
},
styles = {
boxSizing: "border-box",
minHeight: "92px",
minWidth: "320px",
color: "white",
fontSize: "40px",
padding: "20px 30px",
backgroundColor: "#8BC34A",
border: "2px solid #009688",
display: "inline-block",
textAlign: "center",
borderRadius: "3px",
boxShadow: "2px 3px 5px 2px rgba(60, 102, 11, 0.12)",
cursor: "pointer"
},
randomNum = function () { return Math.floor(Math.random() * count)};
// get Roboto font
WebFontConfig = {
google: { families: [ 'Roboto::latin' ] }
};
(function() {
var wf = document.createElement('script');
wf.src = 'https://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
wf.type = 'text/javascript';
wf.async = 'true';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wf, s);
})();
d.className = 'lets-make-fun';
for (i in bodyStyles) {
b.style[i] = bodyStyles[i];
}
for (i in styles) {
d.style[i] = styles[i];
}
c.style.marginTop = "50px";
c.innerHTML = "Klicke für eine zufällige Social Media Idee.";
d.innerHTML = words.data[randomNum()];
e.innerHTML = "Idee Nr. " + randomNum();
document.body.insertBefore(c, document.body.childNodes[0]);
document.body.insertBefore(d, document.body.childNodes[1]);
document.body.insertBefore(e, document.body.childNodes[2]);
d.addEventListener("click", function(){
var newRandomNum = randomNum();
d.innerHTML = words.data[newRandomNum];
e.innerHTML = "Idee Nr. " + newRandomNum ;
});
d.addEventListener("mouseenter", function(){
d.style.backgroundColor = "#84bf40";
});
d.addEventListener("mouseleave", function(){
d.style.backgroundColor = "#8BC34A";
});
Also see: Tab Triggers