How do I place this input element in the bottom of his div parent and center it?
Asked
Active
Viewed 76 times
-4
-
2If you want help with your code, show us your [mcve] code, not just a picture. Otherwise the question is likely to be closed as 'too broad' (there's no clear evidence of any attempt being made) or 'off-topic' (as questions must show the minimal relevant code to reproduce the problem you're experiencing). Incidentally, to those answering: we have no details upon which to base answers, guesses - especially guesses with no explanation of what you're doing, how it's being done or what the code means - is of little use to anyone. – David Thomas Mar 08 '17 at 15:23
-
1Wait ... you need to give more info is it Illustrator? Photoshop? Paint ? – DaniP Mar 08 '17 at 15:27
-
http://stackoverflow.com/questions/585945/how-to-align-content-of-a-div-to-the-bottom – DaniP Mar 08 '17 at 15:34
2 Answers
0
If you're looking to use just CSS for this one you could use position: absolute;
on the input and position: relative;
on the parent.
.parent {
position: relative;
}
input {
bottom: 0;
position: absolute;
width: 100%;
}
Alternatively you could use flexbox along the lines of:
.parent {
display: flex;
flex-direction: column;
justify-content: flex-end;
}

Monkeybrews
- 66
- 1
- 6
-1
parent{
position: relative;
}
child {
position: absolute;
bottom: 0;
}

broodjetom
- 276
- 1
- 11
-
Why -1? This should work for the thing you ask. Please give more information on what you want and give code as well. – broodjetom Mar 08 '17 at 15:26
-
1I down-voted because you attempted to answer a question that presented no code, so we don't know what's going on at all, or what the HTML structure, or any requirements, of the HTML might be. Guesses - especially guesses with no explanation - are of little use to the OP or any future visitors. – David Thomas Mar 08 '17 at 15:27
-
It gives an image, and the css I gave is very generic with 'parent' and 'child'. – broodjetom Mar 08 '17 at 15:31
-
1It's a bit mean to attack with downvotes well-intentioned individuals who seek to help someone who has posted a not-very-well-formatted question. You can make a well-reasoned critique of why the answer doesn't work without also downvoting it. – Rounin Mar 08 '17 at 15:38
-
@Rounin: I don't believe I 'attacked' anyone; I voted in accordance with the '*this answer is not useful*' down-arrow tool-tip, and then explained. – David Thomas Mar 08 '17 at 15:42
-
-