Anzeige

Content verschiebt sich nicht?

Content verschiebt sich nicht? | PSD-Tutorials.de

Erstellt von BlackBoSs, 01.11.2013.

  1. BlackBoSs

    BlackBoSs Aktives Mitglied Kreativ-Flatrate-User

    Dabei seit:
    26.04.2005
    Beiträge:
    966
    Geschlecht:
    männlich
    Software:
    Adobe Photoshop
    Kameratyp:
    Canon EOS 450D
    Content verschiebt sich nicht?
    Hallo Leute,

    Wieso verschiebt sich mein Content nicht automatisch unterhalb von nav Tag ??
    Hintergrund ist nur so groß wie nav Fläche obwohl ich bei height:100% angegeben habe.
    Und es lässt sich weder mit margin-top noch mit top verschieben.


    Hier der HTML CODE:
    Code (Text):
    1. <body>
    2.  
    3. <div id="header">
    4.     <div class="wrapper">  <!-- #######################  WRAPPER (Anfang)  #######################   -->
    5.    
    6.         <nav> <!--   #######################  NAVIGATION / LINKS  (Anfang)    #######################   -->
    7.              <ul>
    8.                  <li><a href="#" class="active">Fachwerkstatt</a></li>
    9.                  <li><a href="#">Unternehmen</a></li>
    10.                  <li><a href="#">Reifen & Felgen</a></li>
    11.                  <li><a href="#">Auto-Checks</a></li>
    12.                  <li><a href="#">Gebrauchtwagen-Verkauf</a></li>
    13.                  <li><a href="#">Kontakt</a></li>
    14.                  <div style="clear:both;"></div>
    15.             </ul>
    16.         </nav>  <!--  #######################  NAVIGATION / LINKS  (Ende)   #######################  -->
    17.    
    18.     </div>   <!-- #######################  WRAPPER (Ende)  #######################   -->
    19.    
    20.    
    21.        <div id="content" class="wrapper">
    22.    
    23.         <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
    24.  
    25. It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
    26.  
    27.  
    28. Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.
    29.  
    30. The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.
    31.  
    32. There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.
    33. </p>
    34.    
    35.    </div>
    36.  
    37.  
    38. </div>  <!-- #######################  BODY (Ende)  #######################   -->
    39.  
    40.  
    41. </body>


    und hier mein CSS Code
    Code (Text):
    1. * {margin:0; padding:0;}
    2.  
    3. .wrapper {width:960px; margin:auto;}
    4.  
    5. #header { height:40px; repeat-x top; background:background: rgb(109,179,242); /* Old browsers */
    6.  
    7. background: -moz-linear-gradient(top,  rgba(109,179,242,1) 0%, rgba(84,163,238,1) 50%, rgba(54,144,240,1) 51%, rgba(30,105,222,1) 100%); /* FF3.6+ */
    8.  
    9. background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(109,179,242,1)), color-stop(50%,rgba(84,163,238,1)), color-stop(51%,rgba(54,144,240,1)), color-stop(100%,rgba(30,105,222,1))); /* Chrome,Safari4+ */
    10.  
    11. background: -webkit-linear-gradient(top,  rgba(109,179,242,1) 0%,rgba(84,163,238,1) 50%,rgba(54,144,240,1) 51%,rgba(30,105,222,1) 100%); /* Chrome10+,Safari5.1+ */
    12.  
    13. background: -o-linear-gradient(top,  rgba(109,179,242,1) 0%,rgba(84,163,238,1) 50%,rgba(54,144,240,1) 51%,rgba(30,105,222,1) 100%); /* Opera 11.10+ */
    14.  
    15. background: -ms-linear-gradient(top,  rgba(109,179,242,1) 0%,rgba(84,163,238,1) 50%,rgba(54,144,240,1) 51%,rgba(30,105,222,1) 100%); /* IE10+ */
    16.  
    17. background: linear-gradient(to bottom,  rgba(109,179,242,1) 0%,rgba(84,163,238,1) 50%,rgba(54,144,240,1) 51%,rgba(30,105,222,1) 100%); /* W3C */
    18.  
    19. filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6db3f2', endColorstr='#1e69de',GradientType=0 ); /* IE6-9 */
    20.  
    21. }
    22.  
    23.  
    24.  
    25.  
    26. /* ###############  NAVIGATION / LINKS  ############### */
    27.  
    28. nav {width:960px; height:40px; position:fixed;}
    29.  
    30. nav ul {list-style:none; position:absolute;}
    31. nav ul li {float:left;}
    32. nav ul li a {padding: 0 20px; text-decoration:none; line-height:40px; height:40px; min-width:30px; font-weight:bold; color:#FFF; display:block; font:Georgia, "Times New Roman", Times, serif; border-right:1px dashed #FFF;}
    33.  
    34.  
    35.  
    36. #content {background:#666; width:960px; top:50px; height:100%;}



    Was muss ich in der CSS-Datei eintragen damit sich der unten liegende div Tag sich automatisch unterhalb anordnet ohne dass ich es mit margin-top oder ähnliches nach unten verschieben muss und es sich automatisch nach unten verlängert sobald mehr Inhalt eingetragen wird?




    Bitte um Tipps.

    Lg
     
    Zuletzt bearbeitet: 01.11.2013
    #1      
  2. Duddle

    Duddle Posting-Frequenz: 14µHz

    Dabei seit:
    03.02.2006
    Beiträge:
    3.864
    Geschlecht:
    männlich
    Ort:
    Dresden
    Content verschiebt sich nicht?
    AW: Content verschiebt sich nicht?

    <nav> hat "position: fixed", welches das Element aus dem Dokumentfluss nimmt, es also keinen Platz mehr einnimmt.
    Die Angaben "top", "left" usw. funktionieren nur in Kombination mit einer "position"-Angabe, die du für #content nicht hast.


    Duddle
     
    #2      
x
×
×