To do this, use position ing. This is an example of a fixed fluid model :
+-------+-----------+ | FIXED | FLUUUUUID | +-------+-----------+
or
+-------+-----------+ | FIXED | FLUUUUUID | | | FLUUUUUID | +-------+-----------+
To solve this problem, you need to make the fixed content positioned absolute , and, I think, being fixed content, you probably know the sizes. And give parents the position: relative and padding-left and min-height these dimensions. In this case, you should never use overflow: hidden or float . So remove both from your CSS and make the following changes:
.user-profile {border: 1px solid #999; position: relative; margin: 25px 0;} .user-profile .user-thumb {border: 1px solid #999; margin: 5px; padding: 3px; border-radius: 3px;}
Instead, as stated above, add padding , min-height for the parent and position: absolute for the child:
.user-profile {border: 1px solid #999; position: relative; margin: 25px 0; padding-left: 68px; min-height: 68px;} .user-profile .user-thumb {border: 1px solid #999; margin: 5px; padding: 3px; border-radius: 3px; position: absolute; top: 0; left: 0;}
Mysterious 68px :
68px calculated as follows:
- Left margin:
5px - Left border:
1px - Left
3px : 3px - Width:
50px - Right
3px : 3px - The correct border:
1px - Right border:
5px
So 5px + 1px + 3px + 50px + 3px + 1px + 5px = 68px .
Text ellipsis
For ellipsis to work on major browsers, you can use the following code:
(selector) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
Just add this to the .user-profile p rule:
.user-profile p {white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
In addition, it is always better to have a z-index for position: absolute elements to work well with other similar elements. Therefore, please add:
.user-profile .more-options-list {position: absolute; right: 0; top: 70px; border: 1px solid #999; width: 100px; display: none; background-color: #fff; z-index: 1;}
So the final code is:
$(function () { $(".more-options").click(function () { $(this).closest(".user-profile").toggleClass("open"); return false; }); });
* {margin: 0; padding: 0; list-style: none; font-size: 12pt;} a {text-decoration: none;} .user-profile {border: 1px solid #999; position: relative; margin: 25px 0; padding-left: 68px; min-height: 68px;} .user-profile .user-thumb {border: 1px solid #999; margin: 5px; padding: 3px; border-radius: 3px; position: absolute; top: 0; left: 0;} .user-profile p {white-space: nowrap; overflow: hidden; text-overflow: ellipsis;} .user-profile p:first-child {margin: 3px 0 0;} .user-profile .more-options {position: absolute; right: 0; top: 0; height: 100%; width: 30px; background: center center no-repeat #ccc; text-indent: -99px; overflow: hidden;} .user-profile .more-options-list {position: absolute; right: 0; top: 70px; border: 1px solid #999; width: 100px; display: none; background-color: #fff; z-index: 1;} .user-profile .more-options-list li, .user-profile .more-options-list li a {display: block;} .user-profile .more-options-list li a {padding: 5px;} .user-profile.open .more-options-list {display: block;} .user-profile.open .more-options, .user-profile .more-options:hover {background-color: #999;} .user-profile.default {width: 250px;} .user-profile.mobile {width: auto;} .user-profile.large {width: 500px;} .user-profile.small {width: 100px;} .user-profile .more-options {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAALCAYAAACZIGYHAAAEJGlDQ1BJQ0MgUHJvZmlsZQAAOBGFVd9v21QUPolvUqQWPyBYR4eKxa9VU1u5GxqtxgZJk6XtShal6dgqJOQ6N4mpGwfb6baqT3uBNwb8AUDZAw9IPCENBmJ72fbAtElThyqqSUh76MQPISbtBVXhu3ZiJ1PEXPX6yznfOec7517bRD1fabWaGVWIlquunc8klZOnFpSeTYrSs9RLA9Sr6U4tkcvNEi7BFffO6+EdigjL7ZHu/k72I796i9zRiSJPwG4VHX0Z+AxRzNRrtksUvwf7+Gm3BtzzHPDTNgQCqwKXfZwSeNHHJz1OIT8JjtAq6xWtCLwGPLzYZi+3YV8DGMiT4VVuG7oiZpGzrZJhcs/hL49xtzH/Dy6bdfTsXYNY+5yluWO4D4neK/ZUvok/17X0HPBLsF+vuUlhfwX4j/rSfAJ4H1H0qZJ9dN7nR19frRTeBt4Fe9FwpwtN+2p1MXscGLHR9SXrmMgjONd1ZxKzpBeA71b4tNhj6JGoyFNp4GHgwUp9qplfmnFW5oTdy7NamcwCI49kv6fN5IAHgD+0rbyoBc3SOjczohbyS1drbq6pQdqumllRC/0ymTtej8gpbbuVwpQfyw66dqEZyxZKxtHpJn+tZnpnEdrYBbueF9qQn93S7HQGGHnYP7w6L+YGHNtd1FJitqPAR+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YzDqTuReeXKcXrVarwWJAc9eH8lLIey2pgZD+TqIKTmK53j6GB1IrLhnsNkmSzU6n8zmI/zPRRQaygqiO0WTf4JDT7oH9KEdzrokQeKcSJpeUZzxgXUXD+RcR85AyRBGQ7AAAAABJRU5ErkJggg==");}
<script src="https://code.jquery.com/jquery-1.9.1.js"></script> <div class="user-profile default"> <img src="http://placehold.it/50" class="user-thumb" /> <div class="user-profile-meta"> <p><a href="#"><strong>Username</strong></a></p> <p><span>Designation</span></p> </div> <a href="#" class="more-options">More Options</a> <ul class="more-options-list"> <li><a href="#">Profile</a></li> <li><a href="#">Settings</a></li> <li><a href="#">Log Out</a></li> </ul> </div> <div class="user-profile mobile"> <img src="http://placehold.it/50" class="user-thumb" /> <div class="user-profile-meta"> <p><a href="#"><strong>Username</strong></a></p> <p><span>Designation</span></p> </div> <a href="#" class="more-options">More Options</a> <ul class="more-options-list"> <li><a href="#">Profile</a></li> <li><a href="#">Settings</a></li> <li><a href="#">Log Out</a></li> </ul> </div> <div class="user-profile large"> <img src="http://placehold.it/50" class="user-thumb" /> <div class="user-profile-meta"> <p><a href="#"><strong>Username</strong></a></p> <p><span>Designation</span></p> </div> <a href="#" class="more-options">More Options</a> <ul class="more-options-list"> <li><a href="#">Profile</a></li> <li><a href="#">Settings</a></li> <li><a href="#">Log Out</a></li> </ul> </div> <div class="user-profile small"> <img src="http://placehold.it/50" class="user-thumb" /> <div class="user-profile-meta"> <p><a href="#"><strong>Username</strong></a></p> <p><span>Designation</span></p> </div> <a href="#" class="more-options">More Options</a> <ul class="more-options-list"> <li><a href="#">Profile</a></li> <li><a href="#">Settings</a></li> <li><a href="#">Log Out</a></li> </ul> </div>
Preview
Here's what it looks like with and without an open menu.


Hope this helps you achieve what you want.