/    Sign up×
Community /Pin to ProfileBookmark

Div within a div – stretch vertically

I have a div within a div that I want to stretch vertically, it works if I specify the pixes but I need a generic solution. The page is a content page for an asp.net master page. Ignore mastersidenav – this is a flyout menu.

[CODE] <div>
<div id=”mastersidenav” class=”sidenav”>
<a href=”javascript:void(0)” class=”closebtn” onclick=”closeNav()”>&times;</a>

<div id=”accordion”>
<h3 class=”accordionheader”>HOME</h3>
<div>
<asp:ImageButton runat=”server” ImageUrl=”/Images/dashboard_menu.png” />
</div>
<h3 class=”accordionheader”>ASSETS</h3>
<div>
<p>———-</p>
</div>
<h3 class=”accordionheader”>REPORTS</h3>
<div>
<p>———-</p>
</div>
<h3 class=”accordionheader”>SETTINGS</h3>
<div>
<p>———-</p>
</div>
</div>
</div>
<div class=”test”>
<span onclick=”openNav()” class=”menuicon” onmouseover=”this.style.cursor=’pointer'”></span>
</div>
</div>[/CODE]

Here is the CSS

[CODE].test {
width: 200px;
height: 100%;
background: #085394;

}

.menuicon {
background: url(../images/menu_icon.png) no-repeat;
width: 75px;
height: 75px;
position: absolute;
top: 110px;
left: 15px;
display: block;
}

[/CODE]

to post a comment
CSS

1 Comments(s)

Copy linkTweet thisAlerts:
@IIShNoIIFeb 20.2017 — Instead of px do as you did with the height, use a percentage.
×

Success!

Help @rocky050371 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...