CSS & HTML Divs werden nebeneinander statt untereinander angezeigt.

  • CSS

Es gibt 4 Antworten in diesem Thema. Der letzte Beitrag () ist von xChRoNiKx.

    CSS & HTML Divs werden nebeneinander statt untereinander angezeigt.

    Guten Tag ,

    folgendes Problem arbeite grad an einem Projekt.
    Script ist schon fertig.
    Nun wollte ich was schlichtes und einfaches als Seite haben.

    Gesagt getan.

    Bekomme allerdings bei folgendem HTML & CSS Code:

    jsfiddle link: jsfiddle.net/896eug1v/

    oder hier die codes :

    Spoiler anzeigen

    HTML-Quellcode

    1. [/spoiler][spoiler]<div class="centerdiv" >
    2. <div class="status_center">
    3. Test
    4. </div>
    5. <div class="zentriert">
    6. <form action="index.php" method="post" autocomplete="off">
    7. <input type="text" class="urlbox" name="link" />
    8. <button type="submit" name="shortsubmit" class="shortsubmit" >button</button>
    9. </form>
    10. </div>
    11. </div>[/spoiler][spoiler]

    Spoiler anzeigen

    HTML-Quellcode

    1. [/spoiler][spoiler]@CHARSET "ISO-8859-1";
    2. * {
    3. margin: 0;
    4. padding: 0;
    5. }
    6. html, body {
    7. width: 100%;
    8. height: 100%;
    9. }
    10. .centerdiv {
    11. font-size: 150%;
    12. font-family: sans-serif;
    13. display: -webkit-flex;
    14. display: -webkit-box;
    15. display: -ms-flexbox;
    16. display: flex;
    17. -webkit-align-items: center;
    18. -webkit-box-align: center;
    19. -ms-flex-align: center;
    20. align-items: center;
    21. }
    22. .zentriert {
    23. text-align: center;
    24. color: #464646;
    25. width: 100%;
    26. }
    27. .status_center {
    28. text-align: center;
    29. color: #464646;
    30. width: 100%;
    31. }
    32. .urlbox {
    33. margin: 0;
    34. width: 50%;
    35. font-family: sans-serif;
    36. font-size: 22px;
    37. appearance: none;
    38. box-shadow: none;
    39. border-radius: none;
    40. padding: 15px 5px;
    41. line-height: 25px;
    42. }
    43. .urlbox:focus {
    44. outline: none;
    45. }
    46. .shortsubmit {
    47. background: #263640;
    48. background-image: -webkit-linear-gradient(top, #263640, #999c9e);
    49. background-image: -moz-linear-gradient(top, #263640, #999c9e);
    50. background-image: -ms-linear-gradient(top, #263640, #999c9e);
    51. background-image: -o-linear-gradient(top, #263640, #999c9e);
    52. background-image: linear-gradient(to bottom, #263640, #999c9e);
    53. -webkit-border-radius: 10;
    54. -moz-border-radius: 10;
    55. border-radius: 10px;
    56. font-family: Arial;
    57. color: #ffffff;
    58. font-size: 22px;
    59. padding: 10px 20px 10px 20px;
    60. border: solid #000000 2px;
    61. text-decoration: none;
    62. }
    63. .shortsubmit:hover {
    64. background: #4d7187;
    65. background-image: -webkit-linear-gradient(top, #4d7187, #88a6ba);
    66. background-image: -moz-linear-gradient(top, #4d7187, #88a6ba);
    67. background-image: -ms-linear-gradient(top, #4d7187, #88a6ba);
    68. background-image: -o-linear-gradient(top, #4d7187, #88a6ba);
    69. background-image: linear-gradient(to bottom, #4d7187, #88a6ba);
    70. text-decoration: none;
    71. }



    Die beiden divs wollen einfach nicht untereinander.
    Das Div "status_center" soll entweder unter "zentriert" oder über. Natürlich auch so gecentert.

    Hatte auch schon google gefrgt aber jaaa viele lösungen ausprobiert und gint trotzdessen nicht.
    Jemand ne Idee warum das nicht geht ?


    greetz
    Grüße , xChRoNiKx

    Nützliche Links:
    Visual Studio Empfohlene Einstellungen | Try-Catch heißes Eisen
    Das siehst schonmal gut aus.
    Sehe auch das dort viel Code rausgeflogen ist und kann nachvollziehen wieso das jetzt geht ^^
    Danke dafür schonmal @Cross

    Fehlt nur noch das des ganze Horizontal & Vertikal gecentert wird (Was ich garnicht erwähnt hatte seh ich grad).
    Da werd ich mich mal dran versuchen. Falls jemand natürlich Lösungsvorschläge hat nehm ich gerne an ;)

    Greetz
    Grüße , xChRoNiKx

    Nützliche Links:
    Visual Studio Empfohlene Einstellungen | Try-Catch heißes Eisen