Artifacts Gallery Guilds Search Wiki Login Register

Welcome, Guest. Please login or register. - Thinking of joining?
a Summer day - @681.10 (what is this?)
Activity rating: Five Stars Posts & Arts: 105/1k.beats Random | Recent Posts | Guild Recents
News: There's a great big indie web tomorrow! :smile: Guild Events: HOMESTUCK ART-APALOOZA

+  MelonLand Forum
|-+  Life & The Web
| |-+  ✁ ∙ Web Crafting
| | |-+  ☔︎ ∙ I need Help!
| | | |-+  Help with Border-Image CSS


« previous next »
Pages: [1] Print Embed
Author Topic: Help with Border-Image CSS  (Read 41 times)
ThistleKnight
Newbie ⚓︎
*
View Profile WWW


⛺︎ My Room

Guild Memberships:
Artifacts:
libraHores???Joined 2026!
« on: a Summer night » Embed

Hello! I am having a problem I'm not sure how to solve. I am working on my links page, and I have a sidenav bar in that page. The padding was displaying perfectly until I added my border-image. this is the first time I've used border-image and I'm not sure whats causing it to shrink so much inside. I linked the page above for people to inspect, and also, here is the code I added to my nav element:
Code
border-style: solid;
border-width: 70px;
border-image-source: url("images/fullscroll.png");
border-image-slice: 19% fill;
border-image-repeat: stretch round;
border-image-outset: 40px;

Thanks all!
Logged

https://thistleknight.nekoweb.org/images/buttonthistleknightcastlewebsite.gif

Artifact Swap: Bird Creature
Rubbereon
Jr. Member ⚓︎
**
View Profile WWWArt


⛺︎ My Room
SpaceHey: Friend Me!
Matrix: Chat!
XMPP: Chat!

Guild Memberships:
Artifacts:
Joined 2025!
« Reply #1 on: a Summer night » Embed

If you open inspect element with f12 and tick off "border-image-source: url("images/fullscroll.png");" you'll immediately see why. The border width (displayed in black) is huge for some reason. (See attached image if it shows up, I dunno how melonland handles attachments)

Turning "border-width: 70px;" off fixes your problem, but consequently, it removes parts of the graphic like the top part of the scroll.

Maybe this can be fixed with some overflow shenanigans, but I don't know how.

Setting all the nav padding values to 0 kind of improves the navbar, but that doesn't fix the problem completely. I'm not sure you'd wanna mess with negative values, but I tried and it wouldn't work, so I'm not sure it's possible.

Alternatively, something I noticed is that by disabling "width: 220px;" it allows the full navbar to display correctly, however now it overlaps with the main area.

My proposed solutions with a small tradeoff for each.

First solution if you don't mind having a smaller-looking scroll.
  • Reduce border-width to 36px at most or 24px at the very least
  • Reduce padding to 0px
  • If border-width is 36px, set the regular width to 240px, it should not overlap with the main scroll area
  • Done, it should look fine now.

Second solution if you don't mind the size of the scroll relative to the page.
  • Increase nav width to 400px
  • Change "left" to 50 on the navbar
  • Change "margin-right" to 50px on the main area
  • and also "margin-left" to 520px on the main area to keep the same size
  • Done, should look good, but it will use nearly all your page, no dead air basically.
  • Bonus: You can still set the padding to 0 if you want, but it doesn't look like it improves things much, so I omitted it.

Again, maybe it's possible to avoid this problem with overflow or by messing with padding and margin on the bullet list area, but I don't know how.  :drat:


* css issue.png (254.89 kB, 493x627 - viewed 2 times.)
Logged

https://bettysgraphics.neocities.org/images/animals/cat%20695.gifFuzzy fwiendhttps://bettysgraphics.neocities.org/images/animals/cat%20696.gifhttps://bettysgraphics.neocities.org/images/animals/cat%20697.gif
https://rubbereon.nekoweb.org/img/penguin.gifLinux userhttps://rubbereon.nekoweb.org/img/penguin.gif
You can also find me on Comfybox.
IndigoGolem
Sr. Member ⚓︎
****
View Profile


What's personal text?
⛺︎ My Room

Artifacts:
I got robbed by Dan Q on Melonland!Joined 2025!
« Reply #2 on: a Summer night » Embed

The best solution i found is to decrease border-width and also have border-image-width (separate properties) for the <nav>, and make the <nav> wide enough (240px) to fit all the buttons without needing a horizontal scroll bar. But i will mention, this makes the page look worse on mobile, or at least with Firefox' responsive design mode.

I'm sure there is a simple way to make the border expand out as border-width increases, rather than always expanding down and right, but i don't know what that way might be.

I've attached a screenshot, and here's the updated CSS. Is this close to what you're looking for?

Spoiler
Code
nav {
    width: 240px;
    height: auto; 
    max-height: 90%;
    position: fixed;
    top: 50px;
    left: 150px;
    overflow: scroll;
    padding: 0px;
    scrollbar-width:none;
        border-style: solid;
        border-width: 30px;
        border-image-source: url("images/fullscroll.png");
        border-image-slice: 19% fill;
        border-image-repeat: stretch round;
        border-image-outset: 40px;
    border-image-width: 70px;
}
[close]



* Screenshot_20260624_190223.jpg (122.3 kB, 1069x743 - viewed 6 times.)
Logged

-Indigo, Anve Ozo %
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
MelonLand @000

Minecraft: Online
Join: craft.melonking.net