Here is a demonstration on how to achieve the design from your image within the existing structure of your HTML. While some parts of your HTML could benefit from more clarity, I have tried to maintain the integrity of your project's structure.
I introduced a wrapper for the long element and another wrapper for the images. The images are now children of the long element. By default, the long element is set as a flex column with items aligned to the center, which helps maintain the height of the image content but may not fully replicate your image.
To align more closely with your image, when the checkbox is checked, I positioned the images absolutely within a relatively positioned parent so that I can anchor them using the bottom
and left
selectors. Finally, I used translate properties to center them since the left
property positions based on the top left corner.
If you have any inquiries, please feel free to ask.
#base {
margin: auto;
width: 1300px;
display: flex;
margin-top: -10px;
margin-bottom: -10px;
}
#left {
width: 260px;
}
#right {
width: 300px;
}
#center {
width: 850px;
background-image: url(https://fancyparts.com/fancyparts/cg/pattern/strip_a/strip_a50.gif);
margin: 0 auto;
height: 40px;
border-radius: 30px;
border: 5px outset #ff8282;
}
#headliner {
height: 20px;
margin-left: 140px;
margin-right: 10px;
}
#navi {
border-width: 8px;
border-style: solid;
border-image: url("") 30 fill round;
width: 170px;
margin-top: 0px;
margin-left: 45px;
}
.centerimage {
width: 50%;
size: 40px;
max-width: 40px;
max-height: 40px;
}
.long-el-wrap {
display: flex;
flex-direction: column;
align-items: center;
gap: 1rem;
padding-top: 1rem;
}
.img-wrap {
display: flex;
}
label {
user-select: none;
}
#absolute-toggle:checked ~ #base .long-el-wrap {
position: relative;
}
#absolute-toggle:checked ~ #base .long-el-wrap .img-wrap {
position: absolute;
bottom: 100%;
left: 50%;
translate: -50% 0;
}
<label for="absolute-toggle">
Toggle Absolute Style
</label>
<input type="checkbox" id="absolute-toggle" />
<br />
<br />
<br />
<div id="base">
<div id="left">
<div id="headliner"></div>
<div id="navi">
<div id="titulo">navigate</div>
<button class="buttonA"><a href="(LINK)"> homepage </a> <img src="" width="15"> </button>
<div id="titulo">socials</div>
<button class="buttonA"><a href="(lINK)"> about me </a> <img src="" width="15"> </button>
</div>
</div>
<div class="long-el-wrap">
<div class="img-wrap">
<img src="https://i.postimg.cc/YSp3TDc2/v.gif" style=";" margin-bottom:="" 18px;="" class="centerimage">
<img src="https://i.postimg.cc/jjZXT6KH/i.gif" style="vertical-align: center;" margin-bottom:="" 18px;="" class="centerimage">
</div>
<div id="center">
<div class="border"></div>
<div id="top">
</div>
</div>
</div>
</div>
<div id="right">
</div>