Divs inside of Div Fill Entire Parent DIV Without Display:Table
From MDN:
The flex CSS property is a shorthand property specifying the ability
of a flex item to alter its dimensions to fill available space.
You need to provide flex: 1;
to .container > div > div
to expand the inner div
elements.
.container > div > div {
border: 5px solid green;
height: 50px
}
Demo
Have a link fill div vertically
Apply height:0px
to the parent elemetns #calla
and #calsd
so that the height:100%
on anchors will work.
Demo
(Parent element needs explicit height set for %
height. refer this old SO question)
Update:
You can also apply display:inline-block;
to the anchors as Jack Pattishall Jr pointed out in the comments
Demo
How to make content fill space inside div tag in html?
I know you said:
I'm trying to avoid tables.
But, they make this really easy, so here's a display: table
based answer:
Live Demo
I can't think of a more eloquent way to do this without resorting to JavaScript.
CSS:
.notificationArea
{
width: 280px;
vertical-align: middle;
text-align:left;
background: #ccc;
display: table
}
.notificationArea a, .notificationArea input {
display: table-cell
}
.notificationArea input {
width: 100%
}
HTML:
<div class="notificationArea">
<a href="#">A</a> <a href="#">B</a>
<input id="Text1" type="text" />
</div>
Inside div 100% height of link
Since the class name is overlay
I believe you want it to overlap the img
?
If so use position: absolute;
. Your div is set to height: 100%;
but its width
is 0
so change it to 100%
as well.
Demo
Related Topics
What Is That Thing Between CSS "Selectors" Called
Input[Type=Number] Placeholder Color in Ff29+
CSS Selectors - How to Select 'For' in CSS
Has the ::-Webkit-Selection Selector Ever Been Supported
How to Force This CSS Grid to Wrap to a New Line Without Specifying Minmax Sizes
Label Next to Selectinput in Shiny
Firefox Issue with Display:Absolute in a Table Cell
CSS Object-Fit Cover Is Stretching a Particular Image in Chrome on MAC
Svg + CSS3 Animation Not Working with Link Markup
Media Queries for Tablet Min-Resolution and Max-Resolution
How to Do Text-Overflow: Ellipsis on Two Lines
404 Errors on Bundled Jquery CSS, VS2012 Publishing to Azure
Nesting Selectors via Loops with SASS
Overflow:Hidden Messing with Margins in Chrome and Safari