Suche im Forum:
Suchen


Autor Nachricht
Beitrag22.02.2010 um 19:10 (UTC)    
Titel: Neueinsteiger

Servus,
ich habe 2 Fragen. Zum "coden" einer Homepage, da ich erst gestern damit begonnen habe.

1. Frage :
Wie binde ich CSS in HTML ein ?
Also ich habe z.B.
<body>
<dif id="Menu">
<a href ="#">Startseite</a> ( was muss ich für die Raute einfügen )
<a href ="#">Newsblog</a> ( was muss ich für die Raute einfügen )
<a href ="#">Gästebuch</a> ( was muss ich für die Raute einfügen )
</dif>
</body>
</html>

Wie binde ich bei diesem Menu nun dieses CSS-Code ein ?
#Menu {width: 700px; margin: atuo; padding: 2pt 10pt; border: 1.5pt solid #448844; backround:#aaffaa; font: bold 11pt arial, sans-serif; font variant: small-caps; letter-spacing: 1pt; text-align: center; }
#Menu a { color #448844; text-decoration : none; margin-right: 5pt; padding: 2pt 2pt; border-left: 1.5pt solid #aaffaa: border-right: 1.5pt solid #aaffaa; }
#Menu a:hover { color: #ee1111; text-decoration: none; backround: #ffffcc; padding: 2pt 2pt; border-left: 1.5pt solid #448844; border-right: 1.5ptsolid #448844; }


2. Frage :
Die stell ich sobald Frage 1 geklärt ist Wink


gr. chris
↑
Beitrag22.02.2010 um 19:47 (UTC)    
Titel: CSS und HTML

Hallo

Für die Raute musst du in diesem Fall die Zieladresse des Links eingeben (href="www.MeineSeite.de").

Die CSS-Definitionen kommen einfach in einen "style"-Befehl für das Menü:

Zitat:

<body>
<div id="Menu" style="width: 700px; margin: atuo; padding: 2pt 10pt; border: 1.5pt solid #448844; backround:#aaffaa; font: bold 11pt arial, sans-serif; font variant: small-caps; letter-spacing: 1pt; text-align: center; ">
<a href ="www.MeineSeite.de/Startseite.htm">Startseite</a>
<a href ="www.MeineSeite.de/Newsblog.htm">Newsblog</a>
<a href ="www.MeineSeite.de/G.ae.stebuch.htm">Gästebuch</a>
</div>
</body>
</html>



Oder, wenn man lieber CSS und HTML getrennt schreiben möchte, weil es evtl. übersichtlicher ist, so:

Zitat:

<style type="text/css">
<!--

#Menu
{
width: 700px;
margin: atuo;
padding: 2pt 10pt;
border: 1.5pt solid #448844;
backround:#aaffaa;
font: bold 11pt arial, sans-serif;
font variant: small-caps;
letter-spacing: 1pt;
text-align: center;
}

#Menu a
{
color #448844;
text-decoration : none;
margin-right: 5pt;
padding: 2pt 2pt;
border-left: 1.5pt solid #aaffaa: border-right: 1.5pt solid #aaffaa;
}

#Menu a:hover
{
color: #ee1111;
text-decoration: none;
backround: #ffffcc;
padding: 2pt 2pt;
border-left: 1.5pt solid #448844;
border-right: 1.5ptsolid #448844;
}

</style>

<div id="Menu">
<a href ="www.MeineSeite.de/Startseite.htm">Startseite</a>
<a href ="www.MeineSeite.de/Newsblog.htm">Newsblog</a>
<a href ="www.MeineSeite.de/G.ae.stebuch.htm">Gästebuch</a>
</div>



Ich hoffe, das hilft weiter.


Gruß

FK
______________
↑
Beitrag23.02.2010 um 12:36 (UTC)    
Titel: Danke

Servus,
jetzt klappt es. Danke Smile

Jetzt mach ich noch schulisches und heut Abend oder in den nechsten Tagen komm ich dann auf die "2. Frage" zurück.

gr. chris
↑
Beitrag25.02.2010 um 19:01 (UTC)    
Titel:

Hallo,
nun zu meiner zweiten Frage.
Wie verlinke ich meine Homepage?

Also folgendes,
ich habe nun ein Menü mit "Starseite" und "Newsblog"
Wie stelle ich nun ein, was die Statseite ist ? Ich hab hier 2 Beispiel codes. Einer soll die Startseite sein und der andere der Newsblog und die möchte im Menü verlinken, wie geht das ??

Dies soll die Startseite sein =>
Code:

<!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" xml:lang="de" lang="de">
<head>
</head>
 <body>
<style type="text/css">
<!--

#seite
{
margin: auto;
width: 1280px;
border: 1px solid black;
background: #FFFACD;
}

</style>

<style type="text/css">
<!--

#Menu
{
width: 800px;
margin: auto;
padding: 2pt 10pt;
border: 1.5pt solid black;
background: #FFA500;
font: bold 10pt arial, sans-serif;
font variant: small-caps;
letter-spacing: 1pt;
text-align: center;
}

#Menu a
{
color: white;
text-decoration : none;
margin-left: 5pt, fixed;
margin-right: 5pt, fixed;
padding: 2pt 2pt;
}

#Menu a:hover
{
color: black;
text-decoration: none;
background: #FFA500;
padding: 2pt 2pt;
}

</style>

<div id="Menu">
<a href ="www.MeineSeite.de/Startseite.htm">STARTSEITE</a>
<a href ="www.MeineSeite.de/Newsblog.htm">NEWSBLOG</a>
</div>
<div id="seite">
<div>Nissi Nissi Nissi Nissi Nissi Nissi Nissi Nissi Nissi Nissi</div>
</div>

</body>
</html>




Dies hier soll der Newsblog auf meiner Homepage sein =>
Code:

<!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" xml:lang="de" lang="de">
<head>
<title>Nissi's Homepage</title>
</head>
<body>
<style type="text/css">
<!--

#seite
{
margin: auto;
width: 1280px;
border: 1px solid black;
background: #FFFACD;
}

</style>

<style type="text/css">
<!--

#Menu
{
width: 800px;
margin: auto;
padding: 2pt 10pt;
border: 1.5pt solid black;
background: #FFA500;
font: bold 10pt arial, sans-serif;
font variant: small-caps;
letter-spacing: 1pt;
text-align: center;
}

#Menu a
{
color: white;
text-decoration : none;
margin-left: 5pt, fixed;
margin-right: 5pt, fixed;
padding: 2pt 2pt;
}

#Menu a:hover
{
color: black;
text-decoration: none;
background: #FFA500;
padding: 2pt 2pt;
}

</style>

<div id="Menu">
<a href ="www.MeineSeite.de/Startseite.htm">STARTSEITE</a>
<a href ="www.MeineSeite.de/Newsblog.htm">NEWSBLOG</a>
</div>
<div id="seite">
<div>Chris Chris Chris Chris Chris Chris Chris</div>
</div>

</body>
</html>


Zuletzt bearbeitet von thebigallianz am 26.02.2010, 14:13, insgesamt 3-mal bearbeitet
↑
Beitrag26.02.2010 um 14:52 (UTC)    
Titel:

*push*
↑
Beiträge der letzten Zeit anzeigen:   


Powered by phpBB © 2001, 2005 phpBB Group
Deutsche Übersetzung von phpBB.de