I am having some trouble positioning a form and text inside of it on my Product Landing page. On the bottom right I have a “form” with a black transparent background, inside I have a “h” and an “ol”. My issue is when I minimize the screen the text starts to go outside of the box even though the “form” is changing its size. Also I am trying to get the form to stick to the right edge of the window but when the screen minimizes that side starts moving in to the left.
I’ve tried everything I can think of so there may be something unnecessary in the CSS. All other code is passing so far.
Thank you so much!
I am using Google Chrome.
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36.
Hi @jamesbuddie1 ,
welcome to the freeCodeCamp forum!
I think the way you declared the width of the form causes trouble. It’s defined as 40% of its parent (<body>). So it shrinks as the window becomes smaller and at certain point the text is too big and sticks outside. Maybe you could give this width a different value. Maybe use position: absolute; and e.g. right: 8px;https://developer.mozilla.org/en-US/docs/Web/CSS/position
I would remove what there is on positioning/margin code and start from the smallest size. Make form 100% wide there and the text stacked vertically. Then add a media-query at large phone/small tablet size, when the 100% look too wide. In the media query give the form a max-width and make it stick to the right … but there are many ways to skin a cat …