Right now I have a navigation bar that looks like:
http://bootply.com/78239
I want to maximize the width of the "search" text-input, without creating line-breaks (i.e., that the "Clear" link will be tight with the "About" link).
I only have basic experience with css and web-design. I read something about "overflow: hidden
" tricks, but I don't understand how to use it when there are more elements to the right of the targeted element.
Thanks
EDIT:
A partial solution can be to set the width "manually" for each case, like in http://bootply.com/78247 :
@media (max-width: 767px) {
#searchbar > .navbar-form {
width: 100%;
}
}
@media (min-width: 768px) and (max-width: 991px) {
#searchbar > .navbar-form {
width: 205px;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
#searchbar > .navbar-form {
width: 425px;
}
}
@media (min-width: 1200px) {
#searchbar > .navbar-form {
width: 625px;
}
}
but this solution will not work when the menu's texts are "dynamic" (for example, contain "Hello username").
I suppose it is not a big issue if you assume that there is a limit on the menu's texts' widths - it's just annoying to calculate/test those widths manually.
I'm just curious to know if there's a neat way to do it automatically.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…