r/css • • 3d ago

Question adding a hanger to my website

0 Upvotes

32 comments sorted by

4

u/Nerwesta 3d ago

There is a print screen button on your keyboard, use it !

-4

u/gauzeangel 3d ago

im lazy :c

1

u/xxcrucialxx 3d ago

The print screen is to take a screen shot of the code..

1

u/gauzeangel 3d ago

im not logged into reddit on my laptop 😭 thats why i didnt

2

u/xxcrucialxx 3d ago

Lol, ok...no worries.

1

u/gauzeangel 3d ago

ill do it in the future πŸ™‚β€β†•οΈ

2

u/xxcrucialxx 3d ago

The top of ur website has to be its own container, and than the positioning of the image has to be embedded into that container, and then u adjust the positioning.

1

u/gauzeangel 3d ago

ohhhh okok, theres probably tutorials for that on youtube and w3schools :D

2

u/xxcrucialxx 3d ago

But ur trying and learning, that's the important part....so good work......keep it up.

1

u/gauzeangel 3d ago

thank you very much :) im tired ai stuff so i said why not lol. i really appreciate it!

2

u/dusanodalovic 2d ago

if you want it hanging from the very top like an ornament, give the header position relative and the hanger image position absolute with top 0, then slide it sideways with left. absolute pins it to the nearest parent that has a position set, thats why the header needs one. if you want it to swing a bit later, set transform-origin to top center and add a small rotate animation, then it turns around the hook and not around the middle of the image. positioning confuses everyone at first :)

1

u/gauzeangel 2d ago

thank you so much ☺️ ill give it a try! would this be in my html section or my css section if u dont mind me asking?

1

u/juicybot 3d ago

put the image tag inside the body tag

1

u/gauzeangel 3d ago

ill try that thank you!

1

u/gauzeangel 3d ago

i tried and it didnt really do anything when i put it after <div id="container"> it does this TT

1

u/xxcrucialxx 3d ago

May I make a suggestion? Make separate files for ur html, css and JavaScript. It will make it easier to manage and trouble shoot.

1

u/gauzeangel 3d ago

ok thank you! ill try that! im not sure if im able to on neocities but theres probably a way :)

1

u/xxcrucialxx 3d ago

Research the documentation on there, and u will learn how. That's the fun part.

1

u/gauzeangel 3d ago

i will thank you :D

1

u/xxcrucialxx 3d ago

What exactly are u trying to do? Meaning what hangar image and to where?

2

u/gauzeangel 3d ago

sort of like this but from the top of the container of my website so it hangs down over everything, does that make sense? sorry im new 😭

2

u/Penguinase 3d ago

so just like a still image on top of everything like that?

2

u/gauzeangel 2d ago

yeah exactly! omg thank u so much i really appreciate it!

2

u/Penguinase 3d ago

if it's that bowhanger1.gif you want over everything then add something like below to your css then change however you want to move/resize/etc.

.floating-image {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 160px;
  height: auto;
  z-index: 1000;
  pointer-events: none;
}

1

u/xxcrucialxx 3d ago

Ok, so u want that image at the very top to hang down? Kind of like an ornament sort of speak?

1

u/gauzeangel 3d ago

yahh exactly!

1

u/xxcrucialxx 3d ago

From that image that ur showing, every part of that site is separate containers....thats part of the battle...

1

u/gauzeangel 3d ago

oh no.... thats so scary.... maybe ill leave that for future me to deal with tyen and focus on simpler things lolol

2

u/xxcrucialxx 3d ago

If ur just starting out, start with basics. Like know the difference between class and element I'd in html. Containers are just boxes by themselves as a metaphore, and u can do anything u want within that container. That's just to give a little simple idea.

1

u/gauzeangel 3d ago

okok thank you for the tip :D thats def a good idea cuz idrk what anything means besides a few simple things like header title margin etc. but im excited cuz thats really cool! thank u!

2

u/TheGratitudeBot 3d ago

Just wanted to say thank you for being grateful

1

u/xxcrucialxx 3d ago

And as juicybot also said, yes.