0

I want to make universal fluid element with solid one near him and place them in line:

// wrapper starts here
[=(XX%)=solid=] [---------------------(auto)-fluid-]
[=(XX%)=solid====================] [--(auto)-fluid-]
[-(auto)-fluid---------------------] [=(XX%)=solid=]
[-(auto)-fluid--] [=(XX%)=solid====================]
// wrapper ends here

But when I tried traditional variant with "float:" style attribute - failed on "input" element: http://jsfiddle.net/iegik/pMRD8/

Also tried hack provided in similar question: What's keeping my input element from displaying like a block element?

1 Answer 1

1

Could use a little javascript and math:

var b = $("#mainWrap").css('padding').split('p')[0];
$("#fluidInput").width($("#mainWrap").width() - $("#btn1").width() - (b * 2));

http://jsfiddle.net/TNCodeMonkey/pMRD8/4/

Sign up to request clarification or add additional context in comments.

2 Comments

Nice answer, but can I avoid JavaScript to do that in CSS only?
I tried a few pure CSS approaches to fixing this, but the javascript is all I could come up with. I like your commitment to keeping it CSS, but sometimes you have to journey to the darkside for some awesomeness :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.