---
title: "Position:relative wrapping and element height?"  
description: "Position:relative wrapping and element height?"  
author: "Anonymous User"  
published: 2013-04-04  
updated: 2013-04-04  
canonical: https://www.mindstick.com/forum/710/position-relative-wrapping-and-element-height  
category: "css-css3"  
tags: ["css-css3"]  
reading_time: 1 minute  

---

# Position:relative wrapping and element height?

Hi Everyone! \
I have a [simple](https://yourviews.mindstick.com/story/1469/5-simple-ways-to-stay-fit-amp-healthy) [TextArea](https://www.mindstick.com/forum/155821/how-we-will-generate-textarea-control-using-htmlhelper-in-razor-view) and a button\
When the [button is clicked](https://www.mindstick.com/forum/157821/write-a-jquery-code-that-selects-all-the-checkboxes-in-a-form-when-a-select-all-button-is-clicked) , I need to wrap (exactly) the text area with a red div (border:solid 1px red)\
p.s this wrapper div must be position:[relative](https://www.mindstick.com/interview/33881/overview-of-relative-absolute-fixed-and-sticky-positioning-in-css) because I need to add [future](https://yourviews.mindstick.com/audio/1195/ayurveda-ancient-wisdom-for-modern-wellness-and-future-health) [absolute](https://www.mindstick.com/interview/1159/what-is-absolute-and-sliding-expiration-in-dot-net) positioned [elements](https://www.mindstick.com/forum/1440/wpf-button-with-multiple-text-elements)\
And so I wrote this code :\
$(".btn").on('click',[function](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server) (){\
$(".myTextArea").wrap($('<span/>', { "class": 'msgAbsWrap', "style": "position:relative;display:inline" /*it's inline by [default](https://www.mindstick.com/interview/12771/what-is-the-importance-of-default-resources) ,I know*/\
}));});\
[Advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams) Thanks!

## Replies

### Reply by Vijay Shukla

Hi Samuel!\
Change the display style of the span to display: inline-block;\
$(".myTextArea").wrap($('<span/>', { "class": 'msgAbsWrap', "style": "position:relative; display:inline-block; width: 100%;"}));\

### Reply by AVADHESH PATEL

Hi Samuel!\
try this way\
CSS:\
.msgAbsWrap { border:solid 1px red; display:inline-block; width:100%; position:relative;}jQuery:\
$(".btn").on('click', function () { $(".myTextArea").wrap($('<span/>', { "class": 'msgAbsWrap' }));});\
it may be it resolve your problem


---

Original Source: https://www.mindstick.com/forum/710/position-relative-wrapping-and-element-height

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
