2013-08-01 90 views
0

我想左側的div擴大到頁面的底部。但問題是,它停在頁面的底部,但當我向下滾動時,它保持在垂直尺寸!它不與滾動道指擴大:-(任何想法請股利不完全擴大100%的高度

的HTML:

<div class="menu_gauche"> 

<div class="ligne_menu_gauche"><div class="accueil"></div><div class="menu_txt">Accueil<a href="/bgladm"><span class="fullspan"></span></a></div></div> 
<div class="ligne_menu_gauche" style="background:#FAFAFA;"><div class="compte"></div><div class="menu_txt">Compte<a href="/bgladm-compte"><span class="fullspan"></span></a></div></div> 
<div class="ligne_menu_gauche"><div class="options"></div><div class="menu_txt">Options<a href="/bgladm-options"><span class="fullspan"></span></a></div></div> 
<div class="ligne_menu_gauche"><div class="notif"></div><div class="menu_txt">Notifications<a href="/bgladm-notif"><span class="fullspan"></span></a></div></div> 
<div class="ligne_menu_gauche"><div class="aide"></div><div class="menu_txt">Aide<a href=""><span class="fullspan"></span></a></div></div> 
<div class="ligne_menu_gauche"><div class="logout"></div><div class="menu_txt">Deconnexion<a href="/logout"><span class="fullspan"></span></a></div></div> 

<div class="vide_menu_gauche"></div> 
</div> 

<div class="contenu_droit"><div class="envglob_form"> 
<div class="enveloppe_form"> 
<input type="text" class="input_text_compte" value="" id="email_compte"> <span>Email</span><br>l 
</div> 

<div class="enveloppe_form"> 
<input type="password" class="input_text_compte" id="mdp_actuel"> <span>Mot de passe actuel</span><br><br> 
<input type="password" class="input_text_compte" id="mdp_1"> <span>Nouveau mot de passe</span><br> 
<input type="password" class="input_text_compte" id="mdp_2"> <span>Retappez le mot de passe</span> 
</div> 

<div class="enveloppe_form"> 
<input type="text" class="input_text_compte" id="nom_compte" value=""> <span>Nom</span><br> 
<input type="text" class="input_text_compte" id="prenom_compte" value=""> <span>Prénom</span><br> 
</div> 

<div class="enveloppe_form"> 
<input type="radio" name="sexe_compte" id="sexe_compteh" value="1"> Homme<br> 
<input type="radio" name="sexe_compte" id="sexe_comptef" value="0" checked=""> Femme 
</div> 

<div class="enveloppe_form"><select id="age"><option value="1933">1933</option><option value="1934">1934</option><option value="1935">1935</option><option value="2004">2004</option></select> <span>Année de naissance</span> 
</div> 

</div> 

<div class="envglob_form2"> 
<div class="enveloppe_form"> 
<div class="interets"><span>Centres d'intérêt</span></div><div class="interets" id="interets_id"><div class="interet_compte"><input type="checkbox" name="interets[]" value="1"> Actualités</div><div class="interet_compte"><input type="checkbox" name="interets[]" value="2" checked=""> Animaux</div><div class="interet_compte"><input type="checkbox" name="interets[]" value="3"> Art</div><div class="interet_compte"><input type="checkbox" name="interets[]" value="4" checked=""> Automobile</div><div class="interet_compte"><input type="checkbox" name="interets[]" value="27"> Autre</div><div class="interet_compte"><input type="checkbox" name="interets[]" value="5"> Cinéma</div><div class="interet_compte"><input type="checkbox" name="interets[]" value="6"> Famille</div><div class="interet_compte"><input type="checkbox" name="interets[]" value="7"> Finance</div><div class="interet_compte"><input type="checkbox" name="interets[]" value="8"> Formation</div><div class="interet_compte"><input type="checkbox" name="interets[]" value="9"> Gastronomie</div><div class="interet_compte"><input type="checkbox" name="interets[]" value="10"> Humour</div><div class="interet_compte"><input type="checkbox" name="interets[]" value="11"> Immobilier</div><div class="interet_compte"><input type="checkbox" name="interets[]" value="12"> Informatique</div><div class="interet_compte"><input type="checkbox" name="interets[]" value="13" checked=""> Internet</div><div class="interet_compte"><input type="checkbox" name="interets[]" value="14"> Jeux</div><div class="interet_compte"><input type="checkbox" name="interets[]" value="15"> Littérature</div><div class="interet_compte"><input type="checkbox" name="interets[]" value="16" checked=""> Maison</div><div class="interet_compte"><input type="checkbox" name="interets[]" value="17"> Mode</div><div class="interet_compte"><input type="checkbox" name="interets[]" value="18"> Moto</div><div class="interet_compte"><input type="checkbox" name="interets[]" value="19"> Musique</div><div class="interet_compte"><input type="checkbox" name="interets[]" value="20"> People</div><div class="interet_compte"><input type="checkbox" name="interets[]" value="21"> Photographie</div><div class="interet_compte"><input type="checkbox" name="interets[]" value="22"> Santé</div><div class="interet_compte"><input type="checkbox" name="interets[]" value="23" checked=""> Sciences</div><div class="interet_compte"><input type="checkbox" name="interets[]" value="24"> Sport</div><div class="interet_compte"><input type="checkbox" name="interets[]" value="25"> Téléphonie</div><div class="interet_compte"><input type="checkbox" name="interets[]" value="26"> Voyage</div> 
</div> 
</div> 
</div> 
<div class="env_save"> 
<div id="canvasloader-container" class="loading_anim" style="display: none;"><div id="canvasLoader" style="display: block; position: absolute; top: -49px; left: -49px;"><canvas width="98" height="98"></canvas><canvas width="98" height="98" style="display: none;"></canvas></div></div> 
<div class="save" id="save_compte"></div> 
</div> 
<a href="/supprcompte" class="bouton_suppr">Supprimer le compte</a> 
</div> 

,你會發現在這裏小提琴的CSS:http://jsfiddle.net/gMNzd/

+0

你的代碼無效。普萊舍檢查你的開始和結束的div標籤 –

+1

我看了看它,這可能不是回答你的問題,但我會用固定的,而不是擔心它滾動位置。 –

+0

我認爲你缺乏一個清晰的。請檢查該 –

回答

0

我的唯一方法已經設法在過去解決這個問題是與JS *的使用jQuery的用於簡化的語法一點點,但純JS將工作一樣好):

$(document).ready(function(){ 
    $(".menu_gauche").height($(".contenu_droit").height()); 
}); 

此外,您會還必須添加一些頂部/底部填充到.menu_gauche以匹配.contenu_droit更完美的對齊方式。

.menu_gauche{ 
    padding-top: 20px; 
    padding-bottom: 20px; 
} 

更新小提琴:http://jsfiddle.net/gMNzd/4/

+0

感謝Nicolae,最後,我已經徹底解決了伊萬的解決方案:將div更改爲固定! – Recif

0

如果你想要的高度進行相應的調整,你可以添加一個clearfix

<div class="left-div">your content here<div class="clearfix"></div></div> 

clearfix在這裏解釋...檢查鏈接
http://www.webtoolkit.info/css-clearfix.html

+0

我相信問題中描述了一個不同的問題。考慮讓演示中的黃色框與綠色框相同的高度。 –

0

你可能想看看http://matthewjamestaylor.com/blog/ultimate-2-column-left-menu-pixels.htm

它描述瞭解決您的問題。

另一種可能的解決方案(更容易我的意見)使用顯示:表顯示:表列顯示:表小區。由於您實際上使用了列,因此表格行爲可能就是您要查找的內容。儘管這可能不適用於舊版瀏覽器,但它取決於你想要的內容。

0

更改.menu_gauche固定並給.contenu_droit利潤率左。 請檢查該小提琴,http://jsfiddle.net/gMNzd/5/

.menu_gauche{ 
    position:fixed; /* Change the Position to fixed */ 
    top:0 ; /* Added */ 
    left: 0; /* Added */ 
    bottom: 0; /* Added */ 
.contenu_droit { 
    margin-left: 175px; 
}  

這也將更好地考慮實用性,你總會有機會獲得導航。