Struggling with a simple question here. I'm experimenting with HTML and CSS, trying to create a page with a central content box flanked by two arrow images on each side. While the concept isn't too difficult, I'm running into issues with using position: absolute; as resizing the window causes the elements to misbehave.
Here's my HTML:
<div id= "left_side">
<a href=""><img id="leftArrow" src="images/lefta.png"/></a>
</div>
<div id="right_side">
<a href=""><img id="rightArrow" src="images/righta.png"/></a>
</div>
<div id="content">
<p>something</p>
<p>more something</p>
</div>
And my CSS is structured like this:
#left_side {
border: black solid 1px;
position: absolute;
left: 0;
width: 10em;
text-align: center;
margin: 65px;
border-radius: 8px 8px 8px 8px;
}
#right_side {
border: black solid 1px;
position: absolute;
right: 0;
width: 10em;
text-align: center;
margin: 65px 210px 0px 0px ;
border-radius: 8px 8px 8px 8px;
}
#content {
background-color: white;
width: 500px;
margin: 15px 320px 15px 320px;
padding: 30px;
border:5px;
border-radius: 8px 8px 8px 8px;
}
I'm looking for advice on how to make the side images/buttons always stay relative to the content box regardless of screen size. Would nesting them in a bigger box be the best approach, or am I heading in the wrong direction altogether? Apologies for the basic question, positioning has always been a challenging aspect for me as a beginner.
Appreciate any help you can offer.