ERLEDIGT
JA
JA
ANTWORTEN
16
16
ZUGRIFFE
558
558
EMPFEHLEN
-
Hallo,
Ich habe eine Vorlage vom Tabellendesign in CSS "umgeschrieben". Habe zwar schon im CSS Codebook gesucht aber nichts gefunden.
1 Wie auf den Foto zu erkennen ist, sind die links eng beieinander. Weder mit der Anweisung
word-spacing oder font-stretch habe ich einen grösseren Abstand erreicht, wobei bei mir word-spacing im IE fehlerhaft dargestellt wird. Im FF ist der Text auch schwarz und im IE blau
. Gibt es noch eine andere Möglichkeit ausser einem Zeilenumbruch den Text
vor dem Bild rechts so zu gestalten das der Text nicht über das Bild geht?
Hier der Code
HTML
Code :1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Grün mit CSS</title> <link href="css/layout.css" rel="stylesheet" type="text/css" /> <link href="css/navigation.css" rel="stylesheet" type="text/css"/> </head> <body> <div id="content"> <img id="logo" src="bilder/header.jpg" alt="Wasserfall" /> <h1 align="center">Hier den Namen eintragen </h1> <div id="button"> <div align="center"><a href="index.html">Start</a> <a href="leistung.html">Leistung</a> <a href="produkte.html">Produkte</a> <a href="kontakt.html">Kontakt</a> <a href="referenzen.html">Überuns</a> <a href="impressum.html">Impressum</a></div> </div><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Duis ligula lorem, consequat eget, tristique nec, auctor quis, purus. Vivamus ut sem. Fusce aliquam nunc vitae purus. Aenean viverra malesuada libero. Fusce ac quam. Donec neque. Nunc venenatis enim nec quam. Cras faucibus, justo vel accumsan aliquam, tellus dui fringilla quam, in condimentum augue lorem non tellus. Pellentesque id arcu non sem placerat iaculis. Curabitur posuere, pede vitae lacinia accumsan, enim nibh elementum orci, ut volutpat eros sapien nec sapien. Suspendisse neque arcu, ultrices commodo, pellentesque sit amet, ultricies ut, ipsum. Mauris et eros eget erat dapibus mollis. Mauris laoreet posuere odio. Nam ipsum ligula, ullamcorper eu, fringilla at, lacinia ut, augue. Nullam nunc.</p> </div> </body> </html>
CSS Layout
Code :1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
/* layout gruen css */ body { background-color: #006633; } #content { width:900px; margin: 20px auto 20px auto; } #logo { background-image: url(../bilder/header.jpg); background-repeat:no-repeat; background-position:center; border: #003300; border-style:inset; margin-bottom:0px; margin-top:0px; } h1 { font-family:Arial, Helvetica, sans-serif; font-style:italic; font-size:36px; border:#003300; border-style:inset; width: 900px; margin-bottom:0px; /* Abstand zur oberen Border*/ margin-top:0px; } p { font-family:Arial, Helvetica, sans-serif; font-style: normal; font-size:12px; border:#003300; border-style:inset; width:900px; margin-bottom:0px; /* Abstand zur oberen Border*/ margin-top:0px; } p,logo { background-image:url(../bilder/wald.jpg); background-repeat:no-repeat; background-position:right; }
Css Navigation
Code :1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
/* navigation gruen css */ #button { background-color: #339933; font-family:Arial, Helvetica, sans-serif; font-style:normal; font-size:14px; border: #003300; border-style:inset; width:900px; height:20px; margin-bottom:0px; margin-top:0px; } a { text-decoration:none; color:#FFFFFF; } a:link, a:visited { text-decoration: underline; color:#FFFFFF; } a:focus { color: #000000; } a:hover { text-decoration: none; }
Vielen Dank im voraus.
RicoGeändert von buddha (17.05.07 um 21:57 Uhr)
-
17.05.07 22:10 #2Maik Tutorials.de Gastzugang
Hi!
Von welchem Foto sprichst du?
Ansonsten versuch es mal mit der margin-Eigenschaft, denn die word-spacing-Eigenschaft funktioniert nur bei aufeinanderfolgenden Wörtern innerhalb eines Elements:
Code :1
<span style="word-spacing:0.5em">Beispieltext mit Wortabstand 0.5em</span>
-
Ja sorry habe vergessen die Fotos hochzuladen. Den Fehler mit der unterschiedlichen Schriftfarbe habe ich gefunden.
-
17.05.07 22:27 #4Maik Tutorials.de Gastzugang
Bei mir wird der Text in den beiden genannten Browsern nicht in unterschiedlichen Farben dargestellt, da, abgesehen von den Links, überhaupt keine Schriftfarbenformatierung vorgenommen wurde.
-
Endlich die Fotos.
Die Ansicht im IE sieht ja auch nicht besonders aus im Gegensatz zum FF. Habe keinen Plan wie man ein Tabellenlayout in sauberes CSS "konvertiert"
Gruß Rico
-
17.05.07 22:38 #6Maik Tutorials.de Gastzugang
Wenn der Text nicht über das Bild am rechten Rand laufen soll, dann verringere mal die Breitenangabe für das p-Element.
Auf den folgenden Seiten kannst du studieren, wie sich ein tabellenloses CSS-Layout erstellen lässt:
-
Habe von 900px auf 700px geändert , da rückt alles im <p> bereich nach links.
-
17.05.07 22:48 #8Maik Tutorials.de Gastzugang
Ja und? Das ist es doch, was du willst:
Gibt es noch eine andere Möglichkeit ausser einem Zeilenumbruch den Text
vor dem Bild rechts so zu gestalten das der Text nicht über das Bild geht?
-
Sieht dann so aus.
-
17.05.07 22:57 #10Maik Tutorials.de Gastzugang
Versuch es mal hiermit:
Code :1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#text { font-family:Arial, Helvetica, sans-serif; font-style: normal; font-size:12px; border:#003300; border-style:inset; width:900px; margin-bottom:0px; /* Abstand zur oberen Border*/ margin-top:0px; background-image:url(../bilder/wald.jpg); background-repeat:no-repeat; background-position:right; } #text p { padding-right: 200px; }Code :1 2 3 4 5 6 7 8
[b]<div id="text">[/b] <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Duis ligula lorem, consequat eget, tristique nec, auctor quis, purus. Vivamus ut sem. Fusce aliquam nunc vitae purus. Aenean viverra malesuada libero. Fusce ac quam. Donec neque. Nunc venenatis enim nec quam. Cras faucibus, justo vel accumsan aliquam, tellus dui fringilla quam, in condimentum augue lorem non tellus. Pellentesque id arcu non sem placerat iaculis. Curabitur posuere, pede vitae lacinia accumsan, enim nibh elementum orci, ut volutpat eros sapien nec sapien. Suspendisse neque arcu, ultrices commodo, pellentesque sit amet, ultricies ut, ipsum. Mauris et eros eget erat dapibus mollis. Mauris laoreet posuere odio. Nam ipsum ligula, ullamcorper eu, fringilla at, lacinia ut, augue. Nullam nunc.</p> [b]</div>[/b]
-
Prima, hat wunderbar geklappt. Bin noch am überlegen wegen dem Linkabstand, mal schaun...
-
17.05.07 23:16 #12Maik Tutorials.de Gastzugang
Hierfür empfehle ich dir die margin-Eigenschaft, wie z.B.
Code :1 2 3 4 5
a { text-decoration:none; color:#FFFFFF; [b]margin:0 10px;[/b] /* Aussenabstand oben/unten = 0, links/rechts = 10px */ }
-
Die Anweisung float right sollte doch ausreichen damit das rechte Bild vom Text umflossen wird?
Gruß Rico
-
18.05.07 06:36 #14Maik Tutorials.de Gastzugang
Ich hab gerade den Eindruck, dass wir hier aneinander vorbei reden, denn dieser Punkt war doch schon geklärt, und nun ging es um den Abstand zwischen den einzelnen Links.
Mit der float:right-Eigenschaft kannst du derzeit nichts bewirken, da das rechte Bild ein Hintergrundbild und kein Grafikelement (img) ist, das auf diese Weise formatiert werden könnte.
-
Hallo,
Auf dem Foto kann man einen Abstand zwischen der Navigationsleiste und dem Text sehen (ca.10px). Im IE wird es allerdings ohne Abstand angezeigt, das wäre in diesem Fall korrekt.
CSS Layout
Code :1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
body { background-color: #006633; } #content { width:900px; margin: 30px auto 20px auto; } #logo { background-image: url(../bilder/header.jpg); background-repeat:no-repeat; background-position:center; border: #003300; border-style:inset; border-width: thick; margin-bottom:0px; margin-top:0px; } h1 { font-family:Arial, Helvetica, sans-serif; color:#FFFFFF; font-style:italic; font-size:36px; margin-top:5px; /* Abstand zum Logo*/ } #wald { background-image:url(../bilder/wald.jpg); background-repeat:no-repeat; background-position: right; } #text { color:#000000; background-color:#FFFFFF; font-family:Arial, Helvetica, sans-serif; font-style: normal; font-size:12px; width:910px; margin-top:0px; padding-bottom:10px; } #text p { padding-right: 30px; padding-left:20px; } #end { background-color: #339933; width: 910px; height:20px; color:#000000; } /* navigation gruen css */ #button { background-color: #339933; font-family:Arial, Helvetica, sans-serif; font-style:normal; font-size:14px; width:910px; height:20px; margin-bottom:0px; } a { text-decoration:none; color:#FFFFFF; margin:0 35px; /* Aussenabstand oben/unten = 0, links/rechts = 10px */ } a:link, a:visited { text-decoration: underline; color:#FFFFFF; } a:focus { color: #000000; } a:hover { text-decoration: none; }
HTML
Code :1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Grün mit CSS</title> <link href="css/layout.css" rel="stylesheet" type="text/css" /> <link href="css/navigation.css" rel="stylesheet" type="text/css"/> </head> <body> <div id="content"> <img id="logo" src="bilder/header.jpg" alt="Wasserfall" /> <h1 align="center">Hier den Namen eintragen </h1> <div id="button"> <div align="center"> <a href="index.html">Start</a> <a href="leistung.html">Leistung</a> <a href="produkte.html">Produkte</a> <a href="Kontakt.html">Kontakt</a> <a href="referenzen.html">Über uns</a> <a href="impressum.html">Impressum</a></div> </div> <div id="text"> <div id="wald"> <img src="bilder/wald.jpg" alt="Wald" width="150" height="150" hspace="2" vspace="2" align="right" id="wald"/> </div> <p><br /> Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p> </div> <div id="end" > <div align="center">Test</div> </div> </div> </body> </html>
.Gruß Rico
Ähnliche Themen
-
JS: break; andere Möglichkeit?
Von parafi im Forum Javascript & AjaxAntworten: 2Letzter Beitrag: 19.01.11, 08:30 -
word spacing
Von harrry im Forum Flash PlattformAntworten: 2Letzter Beitrag: 28.03.07, 14:58 -
andere Möglichkeit für imagemap
Von pascalplus im Forum HTML & XHTMLAntworten: 3Letzter Beitrag: 06.11.05, 01:52 -
str replace;andere möglichkeit
Von slait im Forum PHPAntworten: 4Letzter Beitrag: 04.02.05, 12:43 -
andere Möglichkeit für zeilenumbrüche?
Von Blattspinat im Forum PHPAntworten: 2Letzter Beitrag: 11.01.03, 15:37






Login





