I would like to know the height of a paragraph. Is there any solution? Thanks.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Not in PHP, no. The paragraph will be rendered in the browser; a number of variables can influence the actual height: Operating System font size settings, Zoom settings, availability of fonts…. therefore, the height can be determined only in client-side JavaScript after the page has been rendered.
The jQuery framework has the convenient
.height()that will give you the computed height of a HTML element and bridges a number of cross-browser issues one would have to take care of manually: