HTML CSS Responsive paragraph tag

前端 未结 3 1584
执念已碎
执念已碎 2021-01-16 22:53

I am designing a webpage and I am almost finished but there is a small issue that I can\'t seem to figure out.

HTML:





             


        
3条回答
  •  無奈伤痛
    2021-01-16 23:15

    If you want the green bar to respond to the width of the browser window, I would set your width on .float-box-footer to something like 100%. A percentage value will adjust with the window.

    The problem you're facing now is that the width of .float-box-footer is being defined by the children elements inside there. The padding value on .p5 is forcing the green box open. If you give .float-box-footer a fluid width value like 100% and throw a text-align: right; or float: right; onto .p5 you should be in business.

    I'd suggest reading up on the fundamentals of the CSS box model: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Introduction_to_the_CSS_box_model

提交回复
热议问题