Artifacts Gallery Guilds Search Wiki Login Register

Welcome, Guest. Please login or register. - Thinking of joining?
a Summer night - @868.55
Activity rating: Three Stars Posts & Arts: 46/1k.beats ~ Boop! The forum will close in 132.beats! Random | Recent Posts | Guild Recents
News: :wizard: You can make anything on the web! :wizard: Guild Events: There are no events!

+  MelonLand Forum
|-+  Life & The Web
| |-+  ✁ ∙ Web Crafting
| | |-+  ☔︎ ∙ I need Help!
| | | |-+  border-image trouble! css-help!


« previous next »
Pages: [1] Print Embed
Author Topic: border-image trouble! css-help!  (Read 90 times)
bennizone
Casual Poster ⚓︎
*
View Profile WWWArt


⛺︎ My Room
Itch.io: My Games

Artifacts:
MaggieJoined 2025!
« on: a Summer day » Embed

Hi friends,
well, I'm stumped. I've always had trouble wrapping my head around border-images... and well, I still can't quite figure it out! I'd like to turn a pokémon-card into a border, and then be able to write my text within the information-field, where you'd usually find the pokémon-attacks and such. I used this generator to try and make it work, but alas...

here's my attempt at CSS,
Code
.mag{
border-image-slice: 562 518 537 543 fill;
border-image-width: 200px 160px 200px 160px;
border-image-repeat: stretch repeat stretch repeat;
border-image-source: url("https://bennizone.net/funzone/magnemite/mag_b.png");
border-style: solid; 
background-clip: padding-box;
min-height:500px;
}

and here's the HTML.
Code
<div class="mag">why is this text not inside the card?</div>

What am I doing wrong? Any help appreciated ! Thanks!

Logged


Artifact Swap: Lucky!poochMagic rainbowSmile on, rainbow flower!
Noah_S
Sr. Member ⚓︎
****
View Profile WWWArt


Noah. Earth. I make website. I.. I.. Noah. Earth.
⛺︎ My Room
iMood: Noah_S
RSS: RSS

Guild Memberships:
Artifacts:
Visited on Melon's 10th Anniversary!I got robbed by Dan Q on Melonland!I met Dan Q on Melonland!A coin!EnbyAce
« Reply #1 on: a Summer day » Embed

I've been trying a bunch of different things, and I can't figure it out either.

But if you plan on a static size for the image, another way of doing it is to write the text under it and give its margin-top a negative value. Here's an example code for how I put one image on top of another last week.

Code
<style>
#link {
margin-top: -95px;
margin-left: 56px;
}
</style>

<img src="https://art-noah-s.eu/images/webringwidget.png">
<p id="link"></p>

This is followed by some javascript that defines p id "link" as an image. You could just as well write text about Magnemite between the tags.

Logged

perfectionist_better.gifweb_designer.gifspeed_of_time.gifbutton290.pngmy_dream_wedding.gifClippy beats AI

Artifact Swap: IT'S THE FINAL COUNTDOWNPaw printLarge watercraftGrowing ballMelonland has encountered a bugMerry Christmascomputer screenMessage Buddy
ribose
Sr. Member ⚓︎
****
View Profile WWWArt


⚘ ⚘ ⚘ ⚘ ⚘
⛺︎ My Room
StatusCafe: ribose
iMood: ribose
Itch.io: My Games
RSS: RSS

Guild Memberships:
Artifacts:
Visited on Melon's 10th Anniversary!Learning to swim!Fio the HamsterAmmoniteSee A Bug Summer 2025 ParticipantFirst 1000 Members!
« Reply #2 on: a Summer day » Embed

the first thing i noticed is that your card image has a lot of blank space in it! the way your code is set up does actually place the text within the image, it's just over in that blank area. the first step would be trim off all the transparent parts in an image editor.

next, put the new version of the image into the generator to get new slice and width values.

after that, you can adjust the position of the text within the element by adding some padding. you'll need enough top padding to push the text below the magnemite art on the card, and a little bit of padding on the sides.

« Last Edit: a Summer day by ribose » Logged

https://camo.githubusercontent.com/491b9e205611e603fa426d303bef52528c10ba8b96d3139e39a2e38103e5c563/68747470733a2f2f7269626f2e7a6f6e652f38387833312f736974652f7269626f73652e706e67 https://camo.githubusercontent.com/54e6ab289e4df0e4e42c9c30c886d2d7c8df708686029a1f654e2930389454b4/68747470733a2f2f7269626f2e7a6f6e652f38387833312f6d696e652f76696577736f757263652e706e67 https://camo.githubusercontent.com/f5bfa6417506fb7531aa82818e33c1ab1277070812531c09638c5aca5d2ea164/68747470733a2f2f7269626f2e7a6f6e652f38387833312f6d696e652f7777772e706e67 https://camo.githubusercontent.com/f7d9283e2ad6924bc82c68b6bd1637dfe82b9baa6362247cee489c9f8723bed8/68747470733a2f2f7269626f2e7a6f6e652f38387833312f6d696e652f7465616c2e706e67 https://camo.githubusercontent.com/66b9d37563323d2962eccea0381ded1337d1d12652da870b82e8c40d5c2e0d54/68747470733a2f2f7269626f2e7a6f6e652f73756e6461792f666973682f726174686572626566697368696e2e706e67

Artifact Swap: Sonic the HedgehogMiles Knuckles the EchidnaShadow the HedgehogRouge the BatAmy RoseCream the RabbitE-102 GammaEmerlEggmanBall CreatureLisasimpsonHuman Connectioncinnamoroll gift
Dan Q
Hero Member ⚓︎
*****
View Profile WWWArt


I have no idea what I am doing
⛺︎ My Room
RSS: RSS

Guild Memberships:
Artifacts:
Dan Q Cruisin'I DIDN'T meet Dan Q on Melonland!Visited on Melon's 10th Anniversary!
« Reply #3 on: a Summer day » Embed

the first thing i noticed is that your card image has a lot of blank space in it! the way your code is set up does actually place the text within the image, it's just over in that blank area.

This is your first and most-fundamental problem. E.g. this extra line of CSS will "solve" the problem for you, but not as well as cropping the image down and then using a (smaller) padding:

Code
padding: 200px 160px 200px 160px;

Logged

https://danq.me/_q26t/badges/dan-q-88x31-lighter.gif https://danq.me/_q26t/badges/dan-q-88x31-peekaboo-scroller.gif https://beige-buttons.danq.dev/beige-buttons-88x31.gif https://embed-html.danq.dev/embed-html-88x31.gif

Artifact Swap: PolyamorousI met Dan Q on Melonland!Joined 2025!
Noah_S
Sr. Member ⚓︎
****
View Profile WWWArt


Noah. Earth. I make website. I.. I.. Noah. Earth.
⛺︎ My Room
iMood: Noah_S
RSS: RSS

Guild Memberships:
Artifacts:
Visited on Melon's 10th Anniversary!I got robbed by Dan Q on Melonland!I met Dan Q on Melonland!A coin!EnbyAce
« Reply #4 on: a Summer day » Embed

the first thing i noticed is that your card image has a lot of blank space in it!

Oh, that's why it was centered in the editor I tried. I've never worked with border images, I thought there was something I didn't understand in the code that centered it.

Logged

perfectionist_better.gifweb_designer.gifspeed_of_time.gifbutton290.pngmy_dream_wedding.gifClippy beats AI

Artifact Swap: IT'S THE FINAL COUNTDOWNPaw printLarge watercraftGrowing ballMelonland has encountered a bugMerry Christmascomputer screenMessage Buddy
bennizone
Casual Poster ⚓︎
*
View Profile WWWArt


⛺︎ My Room
Itch.io: My Games

Artifacts:
MaggieJoined 2025!
« Reply #5 on: a Summer day » Embed

Thanks everybody!! re: the blank space, I thought I had to do that because of this tutorial , but in hindsight I'm not even sure I understood their tutorial completely. Anyway, I really appreciate these responses! However, the text still doesn't.. go in the card!

Code
<!DOCTYPE html>
<html>
<style>
.mag{
 border-image-slice: 548 70 140 121 fill;
border-image-width: 300px 56px 119px 93px;
border-image-outset: 0px 0px 0px 0px;
border-image-repeat: stretch repeat stretch repeat;
border-image-source: url("https://bennizone.net/funzone/magnemite/mag_border.png");
border-style: solid; 
background-clip: padding-box;
min-height:500px;
}

</style>
<body>

<div class="mag">why is this text not inside the card?</div>

</body>
</html>


Also, I don't need the box to stay the same height, I don't mind it getting longer. Just not wider, haha.

Logged


Artifact Swap: Lucky!poochMagic rainbowSmile on, rainbow flower!
Noah_S
Sr. Member ⚓︎
****
View Profile WWWArt


Noah. Earth. I make website. I.. I.. Noah. Earth.
⛺︎ My Room
iMood: Noah_S
RSS: RSS

Guild Memberships:
Artifacts:
Visited on Melon's 10th Anniversary!I got robbed by Dan Q on Melonland!I met Dan Q on Melonland!A coin!EnbyAce
« Reply #6 on: a Summer night » Embed

Code
.mag { 
 border-image-slice: 581 70 140 121 fill;
border-image-width: 300px 56px 119px 93px;
border-image-outset: 0px 0px 0px 0px;
border-image-repeat: stretch repeat;
border-image-source: url("https://bennizone.net/funzone/magnemite/mag_border.png");
border-style: solid; 
min-height: 500px;
padding: 300px 56px 19px 93px;
}
<div class="mag">Tested in w3school editor and got text on card</div>

Logged

perfectionist_better.gifweb_designer.gifspeed_of_time.gifbutton290.pngmy_dream_wedding.gifClippy beats AI

Artifact Swap: IT'S THE FINAL COUNTDOWNPaw printLarge watercraftGrowing ballMelonland has encountered a bugMerry Christmascomputer screenMessage Buddy
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 Zap! Want to Login or Join ? Forum Art Hub Chat Webring Editor Recent Edits Tenement Arcade 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 Webrings Internet Phone Book HTML Energy Declarations Hackers & Designers Frutiger Aero Forum m15o's Web Services 32Bit Cafe iMood
Minecraft: Online
Join: craft.melonking.net