Difference between revisions of "CSS"
(→CSS im Header) |
(→CSS im Header) |
||
Line 7: | Line 7: | ||
<syntaxhighlight lang="html4strict"> | <syntaxhighlight lang="html4strict"> | ||
<html> | <html> | ||
− | + | <header> | |
− | + | <style> | |
− | + | a { | |
− | + | text-decoration:none; | |
− | + | color:rgb(40%, 40%, 40%); | |
− | + | } | |
− | + | a:hover { | |
− | + | color: rgb(100%, 0%, 0%); | |
− | + | } | |
− | + | </style> | |
− | + | </header> | |
− | + | ||
− | + | <body> | |
− | + | <h3>Kontakt:</h3> | |
− | + | Digipool-Team<br> | |
+ | <a href="http://www.digipool.info">www.digipool.info</a><br> | ||
+ | <a href="mailto:digipool@uni-kassel.de">digipool@uni-kassel.de</a><br> | ||
+ | </body> | ||
+ | |||
</html> | </html> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<br> | <br> | ||
+ | |||
+ | So sieht die Seite aus: [http://www.digipool.info/tutorials/css/css_in_header.html css_in_header] | ||
== CSS-Datei verlinken == | == CSS-Datei verlinken == |
Revision as of 09:40, 18 November 2011
Contents
CSS im HTML
CSS im Header
<syntaxhighlight lang="html4strict"> <html> <header> <style> a { text-decoration:none; color:rgb(40%, 40%, 40%); } a:hover { color: rgb(100%, 0%, 0%); } </style> </header>
<body>
Kontakt:
Digipool-Team
<a href="http://www.digipool.info">www.digipool.info</a>
<a href="mailto:digipool@uni-kassel.de">digipool@uni-kassel.de</a>
</body>
</html> </syntaxhighlight>
So sieht die Seite aus: css_in_header
CSS-Datei verlinken
Mit dieser Zeile bindet man eine CSS-Datei ein:
<syntaxhighlight lang="html4strict">
<link rel="stylesheet" type="text/css" href="MeinName.css" media="all"/>
</syntaxhighlight>
- Diese Zeile wird in den Head gelegt. (Zwischen <head> und </head>)
- Die Datei "MeinName.css" ist eine normale Text Datei in UTF-8 Kodierung der man die Endung ".css" gibt.
- Der Dateiname muss selbstverständlich mit dem im Link genau übereinstimmen (auch in Groß- und Kleinschreibung).
Typische Webseite
Typischer Aufbau einer Webseite mit Header, Footer, Menü und Content in der Mitte. Das Ganze ist in einen "wrapper" und "inner-wrapper" gepackt.
<syntaxhighlight lang="html4strict"> <html> <head> <title>demo</title> <link rel="stylesheet" type="text/css" href="style.css" media="all"> </head> <body>
<a href="./demo.hmtl">title</a>
<a href="#titel1">projekt1</a>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<a href="#titel1">projekt1</a>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</body> </html> </syntaxhighlight>