Site Header

Shop
DreamUp AI ArtDreamUp
JoinLog In
Upgrade to Core
Theme
Help Center
Terms of Service
Privacy Policy
DeviantArt - Homepage
DeviantArt FacebookDeviantArt XDeviantArt Instagram
AboutContactCore MembershipSell Your Art
DevelopersAdvertiseCareersHelp Center
Terms of ServiceCopyright PolicyPrivacy PolicyEtiquette
Watch Team and join our Community Group for the latest updates and activities.
Join Community
©2026 DeviantArt
All rights reserved

Journal CSS: Buttons

Jul 24, 20073 min read

Deviation Actions

fkinghost's avatar
By
fkinghost
Published: Jul 24, 2007
2.8K Views
I once promised how to get this to work - so here you go. A more in depth explanation will be included in Creative Journal CSS ...whenever I get it finished ;p

The red hover is just for this example, so you can see what's going on. If you copy the code below, the red hover wont be there. Though if you're feeling really fancy, what you can do is set the hover to be a real hover image, make the button shine/glint or something silly like that. Additionally, if you don't want to have to re-edit the single background image each time you add a button, you could make the button the background of the link... which would open the door for animated buttons (which don't make sense, but then, animated stamps don't either :lol:)

You can make your button set as big as you like, and fill it with as many buttons as you like, and put those buttons wherever your heart desires - the last chunk of CSS should be seen only as an example of how to get it working, you'll have to re-write it to suite your button set design.

If you need it, there's my button template to get your buttons going.

Lastly, this technique is not restricted to buttons - you could make the background a map of the world (or a city/town... whatever) and then turn different areas into links for instance. This technique basically emulates HTML Image Maps.

Das fancypant buttons















Das HTML


<div class="buttons">
  <div class="b_1"><a href="#"></a></div>
  <div class="b_2"><a href="#"></a></div>
  <div class="b_3"><a href="#"></a></div>
  <div class="b_4"><a href="#"></a></div>
  <div class="b_5"><a href="#"></a></div>
  <div class="b_6"><a href="#"></a></div>
  <div class="b_7"><a href="#"></a></div>
</div>


Das CSS


.buttons{
  background: url( :link:i.koopseht.net/buttons.png: ) no-repeat;
  width: 302px;
  height: 279px;
  position: relative
}

.buttons br{display:none}

.buttons a{
  display: block;
  width: 50px;
  height: 50px;
  position: absolute
}

.b_1 a{top:25px;left:15px;width:70px;height:70px}
.b_2 a{top:130px;left:30px;width:60px;height:60px}
.b_3 a{top:55px;left:92px;width:93px;height:100px}
.b_4 a{top:170px;left:105px;width:80px;height:80px}
.b_5 a{top:10px;right:30px;width:83px;height:90px}
.b_6 a{top:110px;right:30px;width:80px;height:80px}
.b_7 a{bottom:10px;right:40px;width:70px;height:70px}


Have at it :thumbsup:

© 2007 - 2026 fkinghost
Comments50
anonymous's avatar
Join the community to add your comment. Already a deviant? Log In
CraftyPixel's avatar
CraftyPixel
Dec 22, 2012
Thanks!
More by fkinghost

required viewing

Nov 24, 2020
A little context to the current state of the interwebs. Just be sure to have some antacids handy:

i just woke up

Nov 19, 2020
I just woke up, and I wanna talk about how the first paragraph of so many wikipedia articles is an ancient spell that summons every know-it-all in the universe to try make their mark -- essentially scribbling graffiti all over what should be a clean *introduction* of a historic figure. For example, the entry for Descartes begins like so: René Descartes (/̵d̴e̵ɪ̵ˈ̶k̵ɑ̷ː̷r̸t̴/̸ ̶o̴r̵ ̵U̶K̵:̸ ̶/̵ˈ̸d̴e̴ɪ̸k̵ɑ̵ː̴r̶t̸/̵;̶ ̴F̷r̷e̷n̶c̸h̴:̴ ̴[̶ʁ̵ə̴n̷e̴ ̵d̷e̸k̵a̸ʁ̷t̶]̷ ̸(̵A̸b̴o̶u̴t̷ ̸t̸h̶i̷s̴ ̴s̸o̵u̴n̵d̸l̶i̴s̵t̷e̵n̸)̸;̸ ̷L̴a̸t̸i̶n̵i̸z̵e̷d̷:̵ ̷R̴e̸n̶a̸t̸u̴s̶ ̸C̷a̸r̷t̶e̸s̷i̷u̸s̷;̸[̷b̵]̷ ̴3̷1̸ ̶M̶a̴r̶c̷h̴ ̶1̷5̸9̸6̷ ̸–̸ ̷1̷1̵ ̴F̸e̷b̶r̵u̵a̶r̶y̶ ̷1̶6̴5̴0̷[̷1̸5̶]̴[̸1̵6̷]̶[̷1̴7̶]̷[̷1̷8̴]̸:̶5̷8̸) was a French-born philosopher, mathematician, and scientist. A native of the Kingdom of France, he spent about 20 years (1629–1649) of his life in the Dutch Republic after serving for a while in the D̸u̷t̴c̶h̴ ̴S̷t̴a̶t̵e̴s̸ ̸A̵r̸m̴y̸ ̷o̶f̴ ̶M̸a̸u̸r̸i̷c̸e̸ ̵o̷f̴ ̵N̷a̵s̶s̵a̶u̵,̸ ̷P̵r̴i̴n̴c̶e̵ ̵o̶f̴ ̷O̷r̷a̴n̵g̴e̵ ̷a̵n̷d̷ ̸t̵h̴e̴ ̶S̴t̵a̷d̶t̴h̶o̵l̴d̶e̴r̶ ̴o̴f̴ ̸t̴h̷e̶ ̸U̶n̸i̵t̸e̷d̸ ̴P̷r̴o̸v̸i̴n̸c̴e̴s̴. One of the most notable intellectual figures of the Dutch Golden Age,[19] D̶e̸s̷c̸a̴r̶t̴e̵s̶ ̷i̸s̵ ̷a̸l̸s̶o̵ ̸̮̈́w̸̩̽i̷͔̒ḍ̶̽e̸̥͛ḻ̶̉y̴̨͆ ̸̟̍r̸̢̀ě̵̥g̵͔̑a̵̢̔ŗ̶̚d̷̥͐e̶̻̐ď̷̺ ̶͓̋ ̷̻̳̃̈ạ̵̡͕̠̇̾̽̿s̷̰̝͚̠̀̊ ̷͇̼̩̀͐̐͝ͅo̶̤̰͒͝n̷̬̮̔̄̀ͅë̴̢̘ ̵͎̖̣͘ͅo̶̖͆͋̽f̷̝̺̈́̚͜ ̸̱̦̈́ ̸̜̚t̷̨͉̓̉͐̽̌h̷̞̗̞̭͍͎͓̭̃̆̐̏̓̋͗͘͝ë̶̡̛͖̦̳̼̰̱̾̆́̐͆̚

SMASH IT UP!

Nov 15, 2020
SMASH IT UP! Not to get too existential (or body horror, sorry about the gif, it make me laff), but I just stumbled across the music video to an old favourite. The nostalgia was unexpected, I promise. (no, they don't MEAN IT LITERALLY MOM!)

abracadabra

Nov 5, 2020
From the latest Magic week prompt (link should be in the site header, otherwise also at the end of this journal). The power flowed into him, filling his lungs, spreading out in his blood like oxygen, and settling into the marrow of his bones. He felt himself smile in a way that he hadn't since he was a boy learning to cast his first spell. He had devoted decades to the study of magic, but now, now he was magic. A glow lit the trees around him. He couldn't be sure if it was the setting sun, or if the glow came from his own skin. A beetle crawled on the ground nearby, seemingly unconcerned with what it had just witnessed, but yet its movements were in time with his heartbeat. A bird in the sky flapped its wings to the same rhythm. A breeze plucked at his hair and clothes. He began to dance, slowly at first; he followed the wind, and the wind followed him. He moved faster, twirling and leaping, until even the fallen leaves were dancing around him. When he stopped, all was