Artifacts Gallery Guilds Search Wiki Login Register

Welcome, Guest. Please login or register. - Thinking of joining?
a Summer day - @359.00
Activity rating: Three Stars Posts & Arts: 49/1k.beats Random | Recent Posts | Guild Recents
News: :cry: Are u having fun? Guild Events: There are no events!

+  MelonLand Forum
|-+  Life & The Web
| |-+  ✁ ∙ Web Crafting
| | |-+  CSS you use on every site?


« previous next »
Pages: [1] Print Embed
Author Topic: CSS you use on every site?  (Read 2967 times)
Melooon
Hero Member ⚓︎
*****
View Profile WWWArt


So many stars!
⛺︎ My Room
SpaceHey: Friend Me!
StatusCafe: melon
iMood: Melonking
Itch.io: My Games
RSS: RSS

Guild Memberships:
Artifacts:
Bug!You're a Star!Flinstone VitaminI got robbed by Dan Q on Melonland!Always working hard!Known Apple shill
« on: a Winter day » Embed

There are a few CSS snippets I use on almost every site Iv made; I figured Id share a few of the best here! Feel free to share your CSS snippets! :ha:

Spin! Makes things spin!
Code
.spin {
  animation-name: spin;
  animation-duration: 10000ms;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
}
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}


Hover Twist (like the MK Nav Bar)
Code
.twist {
  transition: 1s;
}
.twist:hover {
  transform: rotate(360deg);
}


Blink! Simulates the old <blink> tag!
Code
.blink {
  animation: blink-animation 0.95s steps(2, start) infinite;
}
@keyframes blink-animation {
  to {
    visibility: hidden;
  }
}


Center: Forces text centering on something (you can also make left right variants)
Code
.center {
  text-align: center !important;
}


Scrollbar styling - basic scrollbar styling on Chrome, Firefox and Safari
Code
* {
	scrollbar-color: #cd7c00 #000020;
}
::-webkit-scrollbar {
	background: #000020;
	width: 8px;
	height: 8px;
}
::-webkit-scrollbar-track {
	background: #000020;
}
::-webkit-scrollbar-thumb {
	background: #cd7c00;
	border-radius: 10px;
}

Bobbing: The bobbing animation used on MelonLand homepage!
Code
.bobbing {
  animation: bobbing 2s ease-in-out infinite;
  animation-direction: alternate;
}
@keyframes bobbing {
  0% {
    transform: translateY(10px);
  }
  100% {
    transform: translateY(-10px);
  }
}

Logged


everything lost will be recovered, when you drift into the arms of the undiscovered

Artifact Swap: Red TulipLurbyPlank
RodFireProductions
Jr. Member ⚓︎
**
View Profile WWW


🍄🖤🐀
⛺︎ My Room
StatusCafe: rodfire8181
iMood: rodfire8181
Itch.io: My Games

Artifacts:
First 1000 Members!Joined 2022!
« Reply #1 on: a Winter day » Embed

This one snippet always ends up on all of my sites. It makes things tremble in fear or excitement! It's the only animation I tend to implement.

Code
.scared {
  animation: an_shake .2s linear infinite;
}
.scared_h:hover {
  animation: an_shake .2s linear infinite;
}
@keyframes an_shake {
  0% { transform: translate(1px, 1px) rotate(0deg); }
  10% { transform: translate(-1px, -2px) rotate(-1deg); }
  20% { transform: translate(-3px, 0px) rotate(1deg); }
  30% { transform: translate(3px, 2px) rotate(0deg); }
  40% { transform: translate(1px, -1px) rotate(1deg); }
  50% { transform: translate(-1px, 2px) rotate(-1deg); }
  60% { transform: translate(-3px, 1px) rotate(0deg); }
  70% { transform: translate(3px, 1px) rotate(-1deg); }
  80% { transform: translate(-1px, -1px) rotate(1deg); }
  90% { transform: translate(1px, 2px) rotate(0deg); }
  100% { transform: translate(1px, -2px) rotate(-1deg); }
}

Logged

https://shroom.ink/images/buttons/Shroom.Ink.gifwe art, web dev, and game devhttps://shroom.ink/images/buttons/DeadInsideArtist.Art.gif
Cele
Hero Member ⚓︎
*****
View Profile WWW


⛺︎ My Room

Artifacts:
Great Posts PacmanFirst 1000 Members!Joined 2022!
« Reply #2 on: a Winter day » Embed

Thanks for those. I have a very simple thing everywhere, image align to right so text can still be next to it. And caption under it if wanna.
Code
figure {
  float: right;
  display: flex;
  flex-flow: column;
  margin: auto;
  max-width:450px;
  padding:5px;
}

figcaption {
  color: #000000;
  padding: 3px;
  text-align: center;
}




Logged

https://64.media.tumblr.com/f339750d47b841f86b411f210c89bc48/a3f9ac693d24060d-e8/s400x600/2fce684b29380077b902465628201ec7b63f98ff.png
http://www.tiptopglobe.com/userbar/7fa851235decd83fb1f04728a2473956.png
http://www.tiptopglobe.com/userbar/f082aecc2519321c0a13c39f701907bf.png
https://img.pokemondb.net/sprites/black-white/anim/normal/gothorita.gif
brisray
Hero Member ⚓︎
*****
View Profile WWW


⛺︎ My Room

Artifacts:
RocketmanFirst 1000 Members!Joined 2023!
« Reply #3 on: a Spring day » Embed

Another spinny thing. This is used on one of my pages to demonstrate moire patterns. A spinnning grid on top of a static one - https://brisray.com/computers/halftone.htm

Code
<style>
#rotate-div {
	position: relative;
	top: 0;
	left: 0;
	margin: auto;
	width: 400px;
	text-align:center;
	padding-top:50px;
	padding-bottom:50px;
}
#steady-img {
	left:0;
	top:0;
}

#rotate-img {
	position: absolute;
	left:50px;
	top:50px;
	-webkit-animation: rotation 15s infinite linear; 
	animation: rotation 15s infinite linear; 
}

 @-webkit-keyframes rotation { 
	from {
		-webkit-transform: rotate(0deg);
	}	to {
		-webkit-transform: rotate(359deg);
	}
}

@keyframes rotation { 
	from {
		transform: rotate(0deg);
	}	to {
		transform: rotate(359deg);
	}
}
</style>

<div id="rotate-div">
	<img src="images/moire-vert.gif" id="steady-img">
	<img src="images/moire-vert.gif" id="rotate-img">
</div>

Logged
HayleyMulch
Full Member ⚓︎
***
View Profile WWW


(she/they) | if my grandmother had wheels, etc.
⛺︎ My Room
SpaceHey: Friend Me!
StatusCafe: hayleymulch
iMood: HayleyMulch

Artifacts:
First 1000 Members!Joined 2022!
« Reply #4 on: a Spring night » Embed

*bookmarks this topic*

Thanks for sharing these! :chef:

Logged

https://hayleymulch.neocities.org/images/daniel-lando.gifhttps://hayleymulch.neocities.org/images/sonic_cd.gif
mir
Newbie ⚓︎
*
View Profile WWW


⛺︎ My Room
StatusCafe: telltaleheart

Artifacts:
Visited on Melon's 10th Anniversary!First 1000 Members!Joined 2023!
« Reply #5 on: a Summer day » Embed

Code
* { box-sizing: border-box;}

no more math when it comes to margins, paddings and borders...

Code
.tilde::before, .tilde::after {
  content: ' ~ ';
}

~ It's cute and it doesn't mess with screen readers ~

Logged

do what you love!
Melooon
Hero Member ⚓︎
*****
View Profile WWWArt


So many stars!
⛺︎ My Room
SpaceHey: Friend Me!
StatusCafe: melon
iMood: Melonking
Itch.io: My Games
RSS: RSS

Guild Memberships:
Artifacts:
Bug!You're a Star!Flinstone VitaminI got robbed by Dan Q on Melonland!Always working hard!Known Apple shill
« Reply #6 on: an Autumn day » Embed

This is a handy snippet you can add to your body tag if your site uses very small text - it stops iPhones from making the text bigger and breaking your layout!

Code
-webkit-text-size-adjust: 100%;

« Last Edit: an Autumn day by Melooon » Logged


everything lost will be recovered, when you drift into the arms of the undiscovered

Artifact Swap: Red TulipLurbyPlank
BinaryDigit
Newbie ⚓︎
*
View Profile WWW


⛺︎ My Room
RSS: RSS

Artifacts:
First 1000 Members!Joined 2023!
« Reply #7 on: an Autumn day » Embed

Thank you for these cool snippets!

I love this typewriter effect, originally from this Codepen: https://codepen.io/geoffgraham/pen/jrWwWM (edit: wow I didn't realize it would embed instead of link!)

Code
/* GLOBAL STYLES */
body {
  background: #333;
  padding-top: 5em;
  display: flex;
  justify-content: center;
}

/* DEMO-SPECIFIC STYLES */
.typewriter h1 {
  color: #fff;
  font-family: monospace;
  overflow: hidden; /* Ensures the content is not revealed until the animation */
  border-right: .15em solid orange; /* The typwriter cursor */
  white-space: nowrap; /* Keeps the content on a single line */
  margin: 0 auto; /* Gives that scrolling effect as the typing happens */
  letter-spacing: .15em; /* Adjust as needed */
  animation: 
    typing 3.5s steps(30, end),
    blink-caret .5s step-end infinite;
}

/* The typing effect */
@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}

/* The typewriter cursor effect */
@keyframes blink-caret {
  from, to { border-color: transparent }
  50% { border-color: orange }
}

Then assign the class "typewriter" to the text you want to use this on in your HTML.


And I know this isn't a retro web thing, more a modern thing, but If I build in light/dark mode, I always use this:

Code
:root {
  --color-bg: #000000;
  --color-fg: #ffffff;
}

@media (prefers-color-scheme: light) {
  :root {
    --color-bg: #ffffff;
    --color-fg: #000000;
  }
}

body {
  background-color: var(--color-bg);
  color: var(--color-fg);
}

Logged
Pages: [1] Print Embed 
« previous next »
 

Melonking.Net © Always and ever was! SMF 2.0.19 | SMF © 2021 | Privacy Notice | Send Feedback | Supporters ♥ Forum Guide | Rules | RSS | WAP | Mobile


MelonLand Badges and Other Melon Sites!

MelonLand Project! Visit the MelonLand Forum! Support the Forum
Visit Melonking.Net! Visit the Gif Gallery! Pixel Sea TamaNOTchi
@000 MelonLand Editor Recent Edits Tenement Arcade Want to Login or Join ? Forum Art Hub Chat Webring Web Guides Graphics Catalogue Wiki Newsletters Image Stream
Melon's Sites TamaNotchi Textures PixelSea GifyPet MoMG Ozwomp Online Loom Videos Leaky Webring Melonking
Tools Melon Software ArtHub Embed Maker ML Passports
Outlinks Frutiger Aero Forum Onio Club m15o's Web Services 32Bit Cafe iMood Webrings Internet Phone Book HTML Energy Declarations Hackers & Designers
Zap!
Minecraft: Online
Join: craft.melonking.net