How to make the paragraph fixed?

this is the HTML structure.

<div id="nav">
<table>...</table>
<p>...</p>
</div>

the table’s height is changed.how to make the paragraph’s location fixed?

you’re right. but the content of the table are input by the admin. the div’s height is fixed.the table’s height is dynamic.is there a way to make the paragraph show at the same location on all the pages.

How do you know how much space the table will need? If someone has set a larger default font size, the table will take up more space than you’re expecting, and so may overlap the paragraph below


<div id="nav">
<table>...</table>
<p style="position:fixed;">...</p>
</div>

Hope that helps

If you know the height of the paragraph, you can specify a padding either on top or bottom of the browser window.


<div id="nav" style="padding-bottom: 50px">
<table>...</table>
<p style="position:fixed; bottom: 0; height: 50px">...</p>
</div>

Position fixed is not like absolute, it will always follow the browser window regardless of its parent element’s position value. If you don’t want to specify a height, then you adjust the bottom padding until the paragraph doesn’t overlap with anything anymore.

As donboe said, you can use position:fixed and set top/bottom and left/right.
That still doesn’t resolve your problem of having a dynamic height table above a fixed position element, unless the div is big enough to cater for the maximum text that will ever be entered in the table, in the maximum font size.