Hallo ich habe auf der Startseite zwei Boxen erstellt. alles super. Jedoch möchte ich gern den Abstand zwischen den beiden Boxen verringern, habe nur einen <br /> zwischen den Boxen, jedoch wenn ich dies entferne, sind sie zu eng zusammen. Wie bekomm ich einen angemessenen Abstand hin.
Abstand verringern
-
-
- Gerade eben
- Anzeige
Hallo!
Wenn du gerade an deiner Website arbeitest oder dein aktuelles Hosting überdenkst: Wir betreiben mit NetzLiving eine Hosting-Plattform, die speziell auf Performance, Sicherheit und einfache Verwaltung ausgelegt ist.
- ✔️ Schnelle Ladezeiten (optimiert für WordPress & Co.)
- ✔️ Deutsche Server & DSGVO-konform
- ✔️ Persönlicher Support (kein 0815-Ticket-System)
-
Hi
Also folgendes...Deine Boxen haben eine "ID" diese darf nur einmal vorkommen, anstatt ID nimmst du class="box"
Beispiel:
CSS:
Hier eine kleine Anleitung zu ID und Klassen: http://www.html-seminar.de/class_und_id.htm
-
vielen dank, aber irgendwie will es nicht funktionieren. wenn ich das ID durch class ersetze ist die Box nicht mehr vorhanden.
Im editor Kopfzeile habe ich hier diesen Code eingefügt für die boxen
<style type="text/css">
<!--
#box{
width: 580px;
padding: 3px 3px 3px 5px;
padding-left: 15px;
border: 1px solid #e0e0e0;
background: #fff;
box-shadow: 1px 1px 0px #000;
border-radius: 5px;
-moz-border-radius:10px; /* Firefox */
-webkit-border-radius:10px; /* Safari, Chrome */
-khtml-border-radius:10px; /* Konqueror */
border-radius:10px; /* CSS3 */
background: -moz-linear-gradient(left,#009000 0%, #EEEEEE 50%, #EEEEEE 50%, #CCCCCC 100%);
background: -webkit-gradient(linear, left top, right top, color-stop(0%,#009000),color-stop(50%,#EEEEEE), color-stop(50%,#EEEEEE), color-stop(100%,#CCCCCC));
}/* Aussehen Balken mit Ueberschrift */
#box h2{
background-color: #009000;
color: white;
font-size: 14px;
margin: -00px 0px 00px -00px;
width: 225px;
padding-left: 50px;
box-shadow: 3px 5px 10px 5px #bbb;
}#box:hover{
padding-left: 15px;
background: #eeeeee
box-shadow: 1px 1px 0px #000;
border-radius: 5px;
-moz-border-radius:10px; /* Firefox */
-webkit-border-radius:10px; /* Safari, Chrome */
-khtml-border-radius:10px; /* Konqueror */
border-radius:10px; /* CSS3 */
background: -moz-linear-gradient(left,#009000 0%, #EEEEEE 50%, #EEEEEE 50%, #CCCCCC 100%);
background: -webkit-gradient(linear, left top, right top, color-stop(0%,#009000),color-stop(50%,#EEEEEE), color-stop(50%,#EEEEEE), color-stop(100%,#CCCCCC));}
-->
</style> -
-
Klassen also "class" wird in CSS mit einem punkt ".box" dargestellt und ids mit raute "#box"
für deinen Fall nimmst du .box und nicht #box sofern du id="box" in class="box" umbenannt hast
Code
Alles anzeigen[COLOR=#333333][FONT=Verdana]<style type="text/css">[/FONT][/COLOR] [COLOR=#333333][FONT=Verdana]<!--[/FONT][/COLOR] [COLOR=#333333][FONT=Verdana].box{ [/FONT][/COLOR]margin-bottom:10px; [COLOR=#333333][FONT=Verdana]width: 580px;[/FONT][/COLOR] [COLOR=#333333][FONT=Verdana]padding: 3px 3px 3px 5px;[/FONT][/COLOR] [COLOR=#333333][FONT=Verdana]padding-left: 15px;[/FONT][/COLOR] [COLOR=#333333][FONT=Verdana]border: 1px solid #e0e0e0;[/FONT][/COLOR] [COLOR=#333333][FONT=Verdana]background: #fff;[/FONT][/COLOR] [COLOR=#333333][FONT=Verdana]box-shadow: 1px 1px 0px #000; [/FONT][/COLOR] [COLOR=#333333][FONT=Verdana]border-radius: 5px; [/FONT][/COLOR] [COLOR=#333333][FONT=Verdana]-moz-border-radius:10px; /* Firefox */[/FONT][/COLOR] [COLOR=#333333][FONT=Verdana]-webkit-border-radius:10px; /* Safari, Chrome */[/FONT][/COLOR] [COLOR=#333333][FONT=Verdana]-khtml-border-radius:10px; /* Konqueror */[/FONT][/COLOR] [COLOR=#333333][FONT=Verdana]border-radius:10px; /* CSS3 */[/FONT][/COLOR] [COLOR=#333333][FONT=Verdana]background: -moz-linear-gradient(left,#009000 0%, #EEEEEE 50%, #EEEEEE 50%, #CCCCCC 100%);[/FONT][/COLOR] [COLOR=#333333][FONT=Verdana]background: -webkit-gradient(linear, left top, right top, color-stop(0%,#009000),color-stop(50%,#EEEEEE), color-stop(50%,#EEEEEE), color-stop(100%,#CCCCCC));[/FONT][/COLOR] [COLOR=#333333][FONT=Verdana]}[/FONT][/COLOR] [COLOR=#333333][FONT=Verdana]/* Aussehen Balken mit Ueberschrift */[/FONT][/COLOR] [COLOR=#333333][FONT=Verdana].box h2{ [/FONT][/COLOR] [COLOR=#333333][FONT=Verdana]background-color: #009000;[/FONT][/COLOR] [COLOR=#333333][FONT=Verdana]color: white;[/FONT][/COLOR] [COLOR=#333333][FONT=Verdana]font-size: 14px;[/FONT][/COLOR] [COLOR=#333333][FONT=Verdana]margin: -00px 0px 00px -00px;[/FONT][/COLOR] [COLOR=#333333][FONT=Verdana]width: 225px;[/FONT][/COLOR] [COLOR=#333333][FONT=Verdana]padding-left: 50px;[/FONT][/COLOR] [COLOR=#333333][FONT=Verdana]box-shadow: 3px 5px 10px 5px #bbb; [/FONT][/COLOR] [COLOR=#333333][FONT=Verdana]}[/FONT][/COLOR] [COLOR=#333333][FONT=Verdana].box:hover{[/FONT][/COLOR] [COLOR=#333333][FONT=Verdana]padding-left: 15px;[/FONT][/COLOR] [COLOR=#333333][FONT=Verdana]background: #eeeeee[/FONT][/COLOR] [COLOR=#333333][FONT=Verdana]box-shadow: 1px 1px 0px #000; [/FONT][/COLOR] [COLOR=#333333][FONT=Verdana]border-radius: 5px; [/FONT][/COLOR] [COLOR=#333333][FONT=Verdana]-moz-border-radius:10px; /* Firefox */[/FONT][/COLOR] [COLOR=#333333][FONT=Verdana]-webkit-border-radius:10px; /* Safari, Chrome */[/FONT][/COLOR] [COLOR=#333333][FONT=Verdana]-khtml-border-radius:10px; /* Konqueror */[/FONT][/COLOR] [COLOR=#333333][FONT=Verdana]border-radius:10px; /* CSS3 */[/FONT][/COLOR] [COLOR=#333333][FONT=Verdana]background: -moz-linear-gradient(left,#009000 0%, #EEEEEE 50%, #EEEEEE 50%, #CCCCCC 100%);[/FONT][/COLOR] [COLOR=#333333][FONT=Verdana]background: -webkit-gradient(linear, left top, right top, color-stop(0%,#009000),color-stop(50%,#EEEEEE), color-stop(50%,#EEEEEE), color-stop(100%,#CCCCCC));[/FONT][/COLOR] [COLOR=#333333][FONT=Verdana]}[/FONT][/COLOR] [COLOR=#333333][FONT=Verdana]-->[/FONT][/COLOR] [COLOR=#333333][FONT=Verdana]</style>[/FONT][/COLOR] -
er kann doch die ID lassen, es reicht das hinzufügen
-
er kann doch die ID lassen, es reicht das hinzufügen
ID nutzt man nicht doppelt für das gibt es Klassen
Wenn man schon helfen möchte sollte man auch auf Fehler hinweisen klar wird es im Browser normal dargestellt aber trotzdem
-
wo ist da was doppelt?
-
<div id="box"> ist zweimal vorhanden darum habe ich das erwähnt
-
hallo, super danke für die erklärung, ja auf fehler hinzuweisen ist schon gut so, nur so kann man dazu lernen;-) Vielen Dank;-)
Jetzt mitmachen!
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!