html - Position span to hang over the relative parent -
i'm trying position span above it's sibling , "hang over" or positioned on top of it's parent. parent relatively positioned.
please view fiddle whole picture
what looks like...
this want like...
the span (tooltip):
.grid-window span.validation-message:after { border-color: #f2dede transparent transparent; border-style: solid; border-width: 8px; content: ""; height: 0; left: 0; position: absolute; top: 40px; width: 0; } .grid-window span.validation-message { background: none repeat scroll 0 0 #f2dede; border: 1px solid #eed3d7; border-radius: 3px 3px 3px 3px; box-shadow: 1px 1px 2px 0 rgba(0, 0, 0, 0.098); color: #b94a48; font-size: 14px; height: 20px; left: 263px; line-height: 20px; padding: 10px; position: absolute; text-align: center; text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.098); top: -26px; width: 100px; }
the parent element:
element.style { display: block; height: auto; left: 488px; outline: 0 none; top: 100px; width: 400px; z-index: 1002; } .ui-dialog { overflow: visible; padding: 0.2em; position: absolute; width: 300px; }
update
as suggested rohrbs, if explicitly set width of span (tooltip) indeed hang on form. isn't practical since each tooltip potentially display different message. question becomes - how can set width dynamic , still have span (tooltip) hang on form?
style .grid-window .control-group .controls
position: relative;
absolute positioned .grid-window span.validation-message
work want.
see this fiddle
update wanted tool-tip width variable have replaced position: absolute;
position: relative;
in .grid-window span.validation-message
, added left: 175px; top: -25px; float: left;
, min-width: 0; max-width: 500px;
width: auto; work. make work want. note float must else won't work.
so, main changes (most important part) float: left; position: relative;
.grid-window span.validation-message
, need not declare position: relative;
.grid-window .control-group .controls
see this fiddle
Comments
Post a Comment