Die zwei bereits erstellten Responsiven Webdesigns sollen jetzt weiter bearbeitet werden…
Responsives Webdesign Version 3:
Probleme gab es in den ersten beiden Versionen nur noch mit der Navigation die sich über den Textbereich geschoben hatte. Hier gibt es nun den ersten Lösungsversuch dazu…
<!DOCTYPE html>
<html lang="de">
<head>
<title>Webdesign Workshop</title>
<link rel="stylesheet" href="01_CSS/01_zentrale.css" type="text/css" />
<link rel="stylesheet" href="01_CSS/600.css" media="screen and (max-width: 600px)">
<link rel="stylesheet" href="01_CSS/galaxy.css" media="screen and (min-width: 360px) and (max-width: 360px) and (min-height: 740px) and (max-height: 740px)">
<meta charset="UTF-8">
</head>
<body>
<div id="wrapper">
<header>
<nav2>
<ul>
<li><a href="index.html">Navigation</a>
<ul>
<li><a href="001.html">Seite 1</a></li>
<li><a href="002.html">Seite 2</a></li>
<li><a href="003.html">Seite 3</a></li>
<li><a href="004.html">Seite 4</a></li>
</ul>
</li>
</ul>
</nav2>
</header> <!-- Ende vom header-Element -->
<nav>
<ul>
<li><a href="index.html">Startseite 1</a></li>
<li><a href="index.html">Startseite 2</a></li>
<li><a href="index.html">Startseite 3</a></li>
<li><a href="index.html">Startseite 4</a></li>
</ul>
</nav> <!-- Ende vom nav-Element -->
<main>
<article>
<h1>Responsiv Version 3:</h1>
<p>
Das Layout “Responsiv Version 1“ ist schon responsiv und bekommt einen roten Hintergrund und einen grünen Kopfbereich. Nur die Navigation schiebt sich über den Textbereich.
</p>
</article>
<br />
<article>
<h1>Lösungsversuch 1 für die Navigation:</h1>
<p>
Die Idee besteht darin, die normale Navigation auszublenden und eine Dropdown-Navigation im header-Bereich einzubauen...
<br /><br />
</p>
</article>
<br />
</main> <!-- Ende vom main-Element -->
<footer> <!-- Anfang vom footer-Element -->
</footer> <!-- Ende vom footer-Element -->
</div> <!-- Ende vom wrapper-Bereich -->
</body>
</html>
Das war jetzt der HTML Quelltext für die Datei “index.html“ und nun fehlen nur noch die CSS-Dateien und die packen wir in den Ordner “01_CSS“.
Der CSS Code für die Datei “01_zentrale.css“:
@import url(02_fundament.css);
@import url(03_body.css);
@import url(04_wrapper.css);
@import url(05_kopfbereich.css);
@import url(06_navibereich.css);
@import url(07_textbereich.css);
@import url(08_artikel.css);
Der CSS Code für die Datei “02_fundament.css“:
@media all {
* {
padding: 0;
margin: 0;
}
html {
height: 101%;
}
} /* Ende von @media nicht löschen*/
Der CSS Code für die Datei “03_body.css“:
@media all {
body {
background-color: white;
color: black;
}
} /* Ende von @media nicht löschen*/
Der CSS Code für die Datei “04_wrapper.css“:
@media all {
#wrapper {
margin: 5px;
background-color: white;
color: black;
}
} /* Ende von @media nicht löschen*/
Der CSS Code für die Datei “05_kopfbereich.css“:
@media all {
header {
height: 80px;
background-image: url(../cpm-header01.jpg);
background-repeat: no-repeat;
background-color: steelblue;
color: white;
margin-top: 5px;
margin-right: 5px;
margin-bottom: 5px;
margin-left: 5px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: solid;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-top-color: black;
border-right-color: black;
border-bottom-color: black;
border-left-color: black;
padding-top: 5px;
padding-right: 5px;
padding-bottom: 5px;
padding-left: 5px;
}
} /* Ende von @media nicht löschen*/
Der CSS Code für die Datei “06_navibereich.css“:
@media all {
nav {
position: absolute;
top: 97px;
left: 5px;
width: 210px;
background-color: steelblue;
color: white;
margin-top: 5px;
margin-right: 5px;
margin-bottom: 5px;
margin-left: 5px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: solid;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-top-color: black;
border-right-color: black;
border-bottom-color: black;
border-left-color: black;
padding-top: 10px;
padding-right: 10px;
padding-bottom: 10px;
padding-left: 10px;
font-family: Arial;
font-size: smaller;
}
nav li {
display: block;
list-style-type: none;
padding: 3px;
}
nav a:link {
color: black;
background-color: white;
display: block;
text-decoration: none;
padding: 3px;
}
nav a:visited {
color: black;
background-color: white;
display: block;
text-decoration: none;
}
nav a:hover {
background-color: red;
color: black;
display: block;
text-decoration: none;
}
nav a:focus {
color: black;
background-color: white;
display: block;
text-decoration: none;
}
nav a:active {
color: black;
background-color: white;
display: block;
text-decoration: none;
}
nav2 {
position: absolute;
left: -9999px;
top: -9999px;
}
} /* Ende von @media nicht löschen*/
Der CSS Code für die Datei “07_textbereich.css“:
@media all {
main {
background-color: steelblue;
color: white;
margin-top: 3px;
margin-right: 5px;
margin-bottom:5px;
margin-left: 241px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: solid;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-top-color: black;
border-right-color: black;
border-bottom-color: black;
border-left-color: black;
padding-top: 20px;
padding-right: 20px;
padding-bottom: 20px;
padding-left: 20px;
font-family: Arial;
font-size: smaller;
}
main a:link {
color: white;
background-color: steelblue;
text-decoration: underline;
}
main a:visited {
color: white;
background-color: steelblue;
text-decoration: underline;
}
main a:hover {
color: black;
background-color: white;
text-decoration: underline;
}
main a:focus {
color: white;
background-color: steelblue;
text-decoration: underline;
}
main a:active {
color: white;
background-color: steelblue;
text-decoration: underline;
}
} /* Ende von @media nicht löschen*/
Der CSS Code für die Datei “08_artikel.css“:
@media all {
article {
overflow: hidden;
color: black;
background-color: lightsteelblue;
padding: 5px;
border-style: solid;
border-color: black;
border-width: 1px;
}
.clearingtext {
clear: both;
background-color: lightsteelblue;
}
.bildlinks {
float: left;
margin-top: 5px;
margin-right: 15px;
margin-bottom: 5px;
margin-left: 0px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: solid;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-top-color: black;
border-right-color: black;
border-bottom-color: black;
border-left-color: black;
}
.bildrechts {
float: right;
margin-top: 5px;
margin-left: 15px;
margin-bottom: 5px;
border-style: solid;
border-width: 1px;
}
} /* Ende von @media nicht löschen*/
Der CSS Code für die Datei “600.css“:
body {
background-color: white;
color: black;
}
header {
background-color: steelblue;
}
nav {
position: absolute;
left: -9999px;
top: -9999px;
width: 210px;
background-color: steelblue;
color: white;
margin-top: 5px;
margin-right: 5px;
margin-bottom: 5px;
margin-left: 5px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: solid;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-top-color: black;
border-right-color: black;
border-bottom-color: black;
border-left-color: black;
padding-top: 10px;
padding-right: 10px;
padding-bottom: 10px;
padding-left: 10px;
font-family: Arial;
font-size: smaller;
}
nav li {
display: block;
list-style-type: none;
padding: 3px;
}
nav a:link {
color: black;
background-color: white;
display: block;
text-decoration: none;
padding: 3px;
}
nav a:visited {
color: black;
background-color: white;
display: block;
text-decoration: none;
}
nav a:hover {
background-color: red;
color: black;
display: block;
text-decoration: none;
}
nav a:focus {
color: black;
background-color: white;
display: block;
text-decoration: none;
}
nav a:active {
color: black;
background-color: white;
display: block;
text-decoration: none;
}
main {
background-color: steelblue;
color: white;
margin-top: 3px;
margin-right: 5px;
margin-bottom:5px;
margin-left: 5px; /*war 241*/
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: solid;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-top-color: black;
border-right-color: black;
border-bottom-color: black;
border-left-color: black;
padding-top: 20px;
padding-right: 20px;
padding-bottom: 20px;
padding-left: 20px;
font-family: Arial;
font-size: smaller;
}
main a:link {
color: white;
background-color: steelblue;
text-decoration: underline;
}
main a:visited {
color: white;
background-color: steelblue;
text-decoration: underline;
}
main a:hover {
color: black;
background-color: white;
text-decoration: underline;
}
main a:focus {
color: white;
background-color: steelblue;
text-decoration: underline;
}
main a:active {
color: white;
background-color: steelblue;
text-decoration: underline;
}
nav2{
position: absolute;
top: 10px;
left: 20px;
}
nav2 li {
display: block;
list-style-type: none;
padding: 3px;
}
nav2 li ul {
position: absolute;
left: -9999px;
top: -9999px;
}
nav2 li:hover ul {
left: 10px;
top: auto;
display: block;
width: 210px;
height: auto;
}
nav2 a:link {
color: black;
background-color: white;
display: block;
text-decoration: none;
padding: 3px;
}
nav2 a:visited {
color: black;
background-color: white;
display: block;
text-decoration: none;
}
nav2 a:hover {
background-color: red;
color: black;
display: block;
text-decoration: none;
}
nav2 a:focus {
color: black;
background-color: white;
display: block;
text-decoration: none;
}
nav2 a:active {
color: black;
background-color: white;
display: block;
text-decoration: none;
}