relative div and button
<!DOCTYPE html>
<html lang="en">
<head>
<style>
.dd1{
position: relative;
height: 400px;
width: 500px;
background-color: aqua;
display: inline-block;
}
</style>
</head>
<body>
<div class="dd1">
</div>
<button>gg</button>
</body>
</html>
if the dd1 has a letter in it like <div> d </div>
then it all will be ok
why this happens and how to fix it for good not like put a p element with opacity 0
28 Replies
lol i found sth better if u add overflow: hidden; then even putting a letter or p element wont fix it
what is the problem exactly?
it looks like it's working as intended to me
so if the
thenn the button stays down
see the picture i uploaded?
it is like that for me
is that not what you want?
I want the button to be up
up where? at the top line of the div?
why would i want it?
top of the line next to the div
I don't know, you just shared code that produces the thing in the image, you never said what you wanted it to do
i want this 🥲
You can do this. I wouldnt recommend using inline-block
i think that its due to the vertical-align
thanks man it worked tnx a ton
I'd recommend using a wrapper rather than setting flex on the body though:
🥲 tnx
ok but still question remains why it is like this ? why it throws things down
because when you set it to display inline-block, the div starts to behave like a letter. The bottom of the "letter" is set on the baseline of the line it's on, so the line o and t and m sit on. Letters like p or q or g go a little below that line.
jochem,can we able to fix that without using the display:flex or grid
i mean with the vertical align thing
Maybe, but why would you want to?
just for curiosity
I think the best answer is "you shouldn't"
okay
emmmm can i bother u more?
how can i get a animation css like this
which lets me to rotate stuff in the background without rotating the box
I got 2 issues here
first is about going
how can i animate it like conic gradient above?
2nd is how can i animate this
again i want to rotate the background not the box with the -25% inset
i would appreciate if u could say it
I'd recommend making a new post, I can't look at the moment
and the intention of the help section is one question per post
ok np
and thanks a ton for help
jochem sorry to interput you could you see this inline prblm https://codepen.io/GOPI-CHAND-SADINENI/pen/xxvgVYq
@BadBoy_YT make your own post, don't hijack others
i am kind of not hijacking ,this is related to this initial question
just make a new one with full question + u can even add more if u got questions
just did that ,thnks