<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Norman&#039;s Blog &#187; Anfänger</title>
	<atom:link href="http://www.normansblog.de/tag/anfaenger/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.normansblog.de</link>
	<description>News über CSS, jQuery, Firefox und andere Browser sowie aktuelle Kinofilme.</description>
	<lastBuildDate>Fri, 21 Sep 2018 13:18:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>Türchen #14: text-indent</title>
		<link>https://www.normansblog.de/tuerchen-14-text-indent/</link>
		<comments>https://www.normansblog.de/tuerchen-14-text-indent/#comments</comments>
		<pubDate>Tue, 14 Dec 2010 18:51:30 +0000</pubDate>
		<dc:creator>Norman</dc:creator>
				<category><![CDATA[Adventskalender 2010]]></category>
		<category><![CDATA[Anfänger]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.normansblog.de/?p=3100</guid>
		<description><![CDATA[Schönen guten Abend! Ein weiterer Tag, ein weiteres Türchen, eigentlich wollte ich mittlerweile mal etwas aufgeholt haben aber irgendwie kommt immer was dazwischen. Aber na gut, kommen wir also zu #14: text-indent. Mit dieser Eigenschaft können wir die erste Zeile eines beliebigen Textblocks manipulieren. Browserunterstützung Browser ab Version 1.0 1.0 3.5 1.0 3.0 Unterstützt ab [...]]]></description>
			<content:encoded><![CDATA[<p>Schönen guten Abend!</p>
<p><a href="http://www.normansblog.de/tuerchen-14-text-indent/"><img src="http://www.normansblog.de/wp-content/uploads/2010/11/adventskalender_14.png" alt="Türchen #14" title="Türchen #14" width="151" height="139" class="alignright size-full wp-image-2862" /></a> Ein weiterer Tag, ein weiteres Türchen, eigentlich wollte ich mittlerweile mal etwas aufgeholt haben aber irgendwie kommt immer was dazwischen. Aber na gut, kommen wir also zu #14: <em>text-indent</em>. Mit dieser Eigenschaft können wir die erste Zeile eines beliebigen Textblocks manipulieren.</p>
<p><span id="more-3100"></span></p>
<h3>Browserunterstützung</h3>
<table class="acenter alignright">
<tr>
<td>Browser</td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/firefox_ico.png" alt="Firefox" title="Firefox" width="16" height="16" class="alignnone size-full wp-image-2887" /></td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/safari_ico.png" alt="Safari" title="Safari" width="16" height="16" class="alignnone size-full wp-image-2890" /></td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/opera_ico.png" alt="Opera" title="Opera" width="16" height="16" class="alignnone size-full wp-image-2889" /></td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/chrome_ico.png" alt="Chrome" title="Chrome" width="16" height="16" class="alignnone size-full wp-image-2886" /></td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/ie_ico.png" alt="Internet Explorer" title="Internet Explorer" width="16" height="16" class="alignnone size-full wp-image-2888" /></td>
</tr>
<tr>
<td>ab Version</td>
<td>1.0</td>
<td>1.0</td>
<td>3.5</td>
<td>1.0</td>
<td>3.0</td>
</tr>
</table>
<p>Unterstützt ab Internet Explorer 3.0, das sagt glaub ich alles. <img src='https://www.normansblog.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Man kann die Eigenschaft also bedenkenlos einsetzen, sie funktioniert ausnahmslos in jedem Browser.</p>
<p>Erfahrene Webdeveloper nutzen diese Technik relativ häufig um beispielsweise Text zu verstecken oder um einen Absatz eingerückt beginnen zu lassen. Für Anfänger jedoch erschließt sich der richtige Gebrauch von <code>text-indent</code> meist etwas zu spät. Deswegen sei hier nochmal darauf hingewiesen, dass man damit nur einzeilige Texte bzw. die erste Zeile eines Textes beeinflussen kann.</p>
<p>Als Werte sind positive wie negative Längenangaben und prozentuale Angaben erlaubt.</p>
<h3>Beispiele</h3>
<p>Beispiel Nummer eins gebraucht <code>text-indent</code> zur Einrückung von Absatzanfängen, als Basis dient uns folgender Code:</p>
<h6>HTML</h6>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, 
sed diam nonumy eirmod tempor invidunt ut labore et dolore 
magna aliquyam erat, sed diam voluptua. At vero eos et accusam 
et justo duo dolores et ea rebum.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span></pre></td></tr></table></div>

<h6>CSS</h6>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">p <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">text-indent</span><span style="color: #00AA00;">:</span><span style="color: #933;">2em</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h6>Ergebnis</h6>
<div style="background-color:#eee;border:1px solid #aaa;padding:10px 10px 0;margin-bottom:10px;">
<p style="text-indent:2em;">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.</p>
</div>
<p>Man beachte, wie die erste Zeile des Absatzes um 2em eingerückt wird, die anderen Zeilen aber nicht.</p>
<blockquote class="idea"><p>Deswegen sollte man <code>text-indent</code> auch niemals in Menüs/Navigationen verwenden, sollte nämlich doch mal ein Menüpunkt umbrechen, ist nur die obere Zeile eingerückt, nicht aber der Rest des Textes. In solchen Fällen ist <code>padding</code> zu bevorzugen.</p>
</blockquote>
<p>Nächstes Beispiel: Wie in <a href="http://www.normansblog.de/tuerchen-3-color-transparent/">Türchen #3</a> angedeutet, wird <code>text-indent</code> gern zum verstecken von Text verwendet, speziell wenn es um Image-Replacement geht. Wollen wir doch noch mal nachsehen, wie genau das funktioniert. Wir nehmen wieder den Absatz von oben und fügen noch ein <code>span</code>-Tag ein, dass wir mit einem Bild (in diesem Fall der Schriftzug meines Blogs) ersetzen wollen..</p>
<h6>HTML</h6>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, 
sed diam nonumy eirmod tempor invidunt ut labore et dolore 
magna aliquyam erat, sed diam voluptua. <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;logo&quot;</span>&gt;</span>Norman's Blog<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span> 
At vero eos et accusam et justo duo dolores et ea rebum.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span></pre></td></tr></table></div>

<h6>CSS</h6>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.logo</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">transparent</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">normansblog_logo.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #3333ff;">:inline-</span>block<span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*damit height und width greift*/</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">29px</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*Höhe des Bildes*/</span>
	<span style="color: #000000; font-weight: bold;">text-indent</span><span style="color: #00AA00;">:</span><span style="color: #933;">-9999px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">vertical-align</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">bottom</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">150px</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*Breite des Bildes*/</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h6>Ergebnis</h6>
<div style="background-color:#eee;border:1px solid #aaa;padding:10px 10px 0;margin-bottom:10px;">
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. <span style="background:transparent url(http://www.normansblog.de/wp-content/uploads/2010/12/normansblog_logo-150x29.png) no-repeat 0 0;display:inline-block;height:29px;text-indent:-9999px;vertical-align:bottom;width:150px;">Norman&#8217;s Blog</span> At vero eos et accusam et justo duo dolores et ea rebum.</p>
</div>
<p>Soviel dazu, <code>text-indent</code> ist also eine nützliche Sache, die man im Hinterkopf behalten sollte.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.normansblog.de/tuerchen-14-text-indent/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Türchen #13: cursor</title>
		<link>https://www.normansblog.de/tuerchen-13-cursor/</link>
		<comments>https://www.normansblog.de/tuerchen-13-cursor/#comments</comments>
		<pubDate>Mon, 13 Dec 2010 22:11:23 +0000</pubDate>
		<dc:creator>Norman</dc:creator>
				<category><![CDATA[Adventskalender 2010]]></category>
		<category><![CDATA[Anfänger]]></category>
		<category><![CDATA[Browser]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.normansblog.de/?p=3087</guid>
		<description><![CDATA[Schönen guten Abend! Auch an diesem wundervollen Abend gilt es einmal mehr ein Türchen im Adventskalender zu öffenbaren, diesmal verbirgt sich dahiner.. cursor! Mit dieser tollen Eigenschaft ist es uns möglich, das Bild des Mauszeigers zu ändern, wenn dieser über bestimmte Elemente unserer Webseite fährt bzw. ruht. Browserunterstützung Browser ab Version 1.0 1.2 7.0 1.0 [...]]]></description>
			<content:encoded><![CDATA[<p>Schönen guten Abend!</p>
<p><a href="http://www.normansblog.de/tuerchen-13-cursor/"><img src="http://www.normansblog.de/wp-content/uploads/2010/11/adventskalender_13.png" alt="Türchen #13" title="Türchen #13" width="151" height="139" class="alignright size-full wp-image-2862" /></a> Auch an diesem wundervollen Abend gilt es einmal mehr ein Türchen im Adventskalender zu öffenbaren, diesmal verbirgt sich dahiner.. <em>cursor</em>! Mit dieser tollen Eigenschaft ist es uns möglich, das Bild des Mauszeigers zu ändern, wenn dieser über bestimmte Elemente unserer Webseite fährt bzw. ruht.</p>
<p><span id="more-3087"></span></p>
<h3>Browserunterstützung</h3>
<table class="acenter alignright">
<tr>
<td>Browser</td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/firefox_ico.png" alt="Firefox" title="Firefox" width="16" height="16" class="alignnone size-full wp-image-2887" /></td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/safari_ico.png" alt="Safari" title="Safari" width="16" height="16" class="alignnone size-full wp-image-2890" /></td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/opera_ico.png" alt="Opera" title="Opera" width="16" height="16" class="alignnone size-full wp-image-2889" /></td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/chrome_ico.png" alt="Chrome" title="Chrome" width="16" height="16" class="alignnone size-full wp-image-2886" /></td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/ie_ico.png" alt="Internet Explorer" title="Internet Explorer" width="16" height="16" class="alignnone size-full wp-image-2888" /></td>
</tr>
<tr>
<td>ab Version</td>
<td>1.0</td>
<td>1.2</td>
<td>7.0</td>
<td>1.0</td>
<td>4.0</td>
</tr>
</table>
<p><code>cursor</code> hat sehr viele mögliche Werte, angefangen vom normalen Pfeil, über eine Hand, bis hin zu einer Sanduhr kann man so ziemlich alles damit machen. Die Unterstützung an der Browserfront ist sehr gut, einige extravagante Icons sind allerdings erst in höheren Versionen nutzbar bzw. abhängig vom jeweiligen Betriebssystem.</p>
<p>Von der Syntax her ist <code>cursor</code> ganz einfach aufgebaut und kann auf jedes Elemente angewendet werden. Nach der Eigenschaft folgt einfach eines der vielen Schlüsselwörter. Man kann auch eigene Cursor verwenden, hierzu benötigt man jedoch eine .cur-Datei (eine besondere Form des <a href="http://en.wikipedia.org/wiki/ICO_%28file_format%29">.ico Formats</a>). Diese bindet man dann über <code>url(pfad-zur-cursor-datei)</code> ein.</p>
<h6>CSS</h6>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">abbr <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">cursor</span><span style="color: #00AA00;">:</span><span style="color: #993333;">help</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.wait</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">cursor</span><span style="color: #00AA00;">:</span><span style="color: #993333;">wait</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.hide-cursor</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">cursor</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h3>Beispiele</h3>
<p>Im Folgenden werde ich mal einige Werte auflisten, wenn ihr über den Listeneintrag fahrt, werden ihr sehen, wie sich euer Mauszeiger verändert.</p>
<ul>
<li style="cursor:default;">default</li>
<li style="cursor:none;">none</li>
<li style="cursor:help;">help</li>
<li style="cursor:pointer;">pointer</li>
<li style="cursor:progress;">progress</li>
<li style="cursor:wait;">wait</li>
<li style="cursor:crosshair;">crosshair</li>
<li style="cursor:move;">move</li>
<li style="cursor:n-resize;">n-resize</li>
</ul>
<p>Eine <a href="https://developer.mozilla.org/de/CSS/cursor">komplette Übersicht</a> mit allen möglichen Werten gibt es unter anderem im <abbr title="Mozilla Developer Network">MDN</abbr>. Wie ihr sicherlich schon richtig vermutet, kann man <code>cursor</code> dazu nutzen, um damit allerhand Blödsinn anzustellen. Das ist natürlich nicht der Sinn des Erfinders. Vielmehr würde ich mir wünschen, dass bei anklickbaren Elemente (in Zeiten von jQuery und Co. kann das ja alles sein) ein Pointer-Cursor erscheint, und bei <a href="http://webstandard.kulando.de/static/css3-windows-7">Dialogboxen/Fenstern</a> entsprechend ein Move-Cursor.</p>
<p>Für erklärende Elemente, wie das <code>abbr</code>-Tag beispielsweise, sollte man <code>cursor:help</code> setzen, damit der User weiß: &#8220;Ah, hier wird mir etwas erklärt, hier bekomme ich Hilfe.&#8221; Kleine Dinge, die die Usability einer Seite aber entscheidend beeinflussen können, aber <strong>bitte nutzt es in Maßen!</strong> <img src='https://www.normansblog.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>https://www.normansblog.de/tuerchen-13-cursor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Türchen #12: caption-side</title>
		<link>https://www.normansblog.de/tuerchen-12-caption-side/</link>
		<comments>https://www.normansblog.de/tuerchen-12-caption-side/#comments</comments>
		<pubDate>Sun, 12 Dec 2010 21:35:09 +0000</pubDate>
		<dc:creator>Norman</dc:creator>
				<category><![CDATA[Adventskalender 2010]]></category>
		<category><![CDATA[Anfänger]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.normansblog.de/?p=3070</guid>
		<description><![CDATA[Das Dutzend ist voll &#8211; Bergfest! Wenn wir nun einmal mit Tables angefangen haben, machen wir doch gleich damit weiter. Noch eine Eigenschaft, die es nur für Tables gibt, ist caption-side. Sie ist fest an das caption-Tag gebunden und setzt logischer Weise voraus, dass ihr solches auch benutzt. Die Eigenschaft gibt dabei an, auf welcher [...]]]></description>
			<content:encoded><![CDATA[<p>Das Dutzend ist voll &#8211; Bergfest!</p>
<p><a href="http://www.normansblog.de/tuerchen-12-caption-side/"><img src="http://www.normansblog.de/wp-content/uploads/2010/11/adventskalender_12.png" alt="Türchen #12" title="Türchen #12" width="151" height="139" class="alignright size-full wp-image-2862" /></a> Wenn wir nun einmal mit Tables angefangen haben, machen wir doch gleich damit weiter. Noch eine Eigenschaft, die es nur für Tables gibt, ist <em>caption-side</em>. Sie ist fest an das <code>caption</code>-Tag gebunden und setzt logischer Weise voraus, dass ihr solches auch benutzt. Die Eigenschaft gibt dabei an, auf welcher Seite der Tabelle der Titel ausgegeben werden soll.</p>
<p><span id="more-3070"></span></p>
<h3>Browserunterstützung</h3>
<table class="acenter alignright">
<tr>
<td>Browser</td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/firefox_ico.png" alt="Firefox" title="Firefox" width="16" height="16" class="alignnone size-full wp-image-2887" /></td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/safari_ico.png" alt="Safari" title="Safari" width="16" height="16" class="alignnone size-full wp-image-2890" /></td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/opera_ico.png" alt="Opera" title="Opera" width="16" height="16" class="alignnone size-full wp-image-2889" /></td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/chrome_ico.png" alt="Chrome" title="Chrome" width="16" height="16" class="alignnone size-full wp-image-2886" /></td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/ie_ico.png" alt="Internet Explorer" title="Internet Explorer" width="16" height="16" class="alignnone size-full wp-image-2888" /></td>
</tr>
<tr>
<td>ab Version</td>
<td>1.0</td>
<td>1.0</td>
<td>4.0</td>
<td>1.0</td>
<td>8.0</td>
</tr>
</table>
<p><code>caption-side</code> hat zwei Werte, die von Bedeutung sind: <code>top</code> und <code>bottom</code>, wobei erstes den Defaultwert darstellt. Firefox unterstützt zudem auch noch <code>left</code> und <code>right</code>. Die Wahrscheinlichkeit aber, mit der ein Fall eintritt, indem einer dieser beiden Werte nötig wären, geht quasi gegen Null.</p>
<h3>Beispiel</h3>
<p>Wie letztens gehts mit einer normalen Tabelle los, diese hier wird auch eine <code>caption</code> (Überschrift, Bezeichnung) haben, denn darum gehts uns ja.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">table</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">caption</span>&gt;</span>Besucherzahlen<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">caption</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">thead</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">tr</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">th</span>&gt;</span>Monat<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">th</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">th</span>&gt;</span>Besucher<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">th</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">tr</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">thead</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">tbody</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">tr</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;</span>11/2010<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;</span>2.744<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">tr</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">tr</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;</span>10/2010<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;</span>2.503<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">tr</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">tr</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;</span>09/2010<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;</span>2.771<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">tr</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">tbody</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">table</span>&gt;</span></pre></td></tr></table></div>

<p>Da <code>caption-side:top</code> der Standard ist, erwartet uns folgende Ausgabe:</p>
<table style="margin:10px auto;">
<caption>Besucherzahlen</caption>
<thead>
<tr>
<th>Monat</th>
<th>Besucher</th>
</tr>
</thead>
<tbody>
<tr>
<td>11/2010</td>
<td>2.744</td>
</tr>
<tr>
<td>10/2010</td>
<td>2.503</td>
</tr>
<tr>
<td>09/2010</td>
<td>2.771</td>
</tr>
</tbody>
</table>
<p>Jetzt nutzen wir <code>caption-side:bottom</code> und wenden es am caption-Tag an.</p>
<h6>CSS</h6>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">caption <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">caption-side</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">bottom</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Damit sieht unsere Tabelle dann so aus:</p>
<table style="margin:10px auto;">
<caption style="caption-side:bottom;">Besucherzahlen</caption>
<thead>
<tr>
<th>Monat</th>
<th>Besucher</th>
</tr>
</thead>
<tbody>
<tr>
<td>11/2010</td>
<td>2.744</td>
</tr>
<tr>
<td>10/2010</td>
<td>2.503</td>
</tr>
<tr>
<td>09/2010</td>
<td>2.771</td>
</tr>
</tbody>
</table>
<p>Das Gleiche könnt ihr jetzt ja mal für <code>left</code> und <code>right</code> im Firefox probieren. <img src='https://www.normansblog.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>https://www.normansblog.de/tuerchen-12-caption-side/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Türchen #11: empty-cells</title>
		<link>https://www.normansblog.de/tuerchen-11-empty-cells/</link>
		<comments>https://www.normansblog.de/tuerchen-11-empty-cells/#comments</comments>
		<pubDate>Sat, 11 Dec 2010 20:18:51 +0000</pubDate>
		<dc:creator>Norman</dc:creator>
				<category><![CDATA[Adventskalender 2010]]></category>
		<category><![CDATA[Anfänger]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.normansblog.de/?p=3057</guid>
		<description><![CDATA[Und weiter geht&#8217;s.. Manchmal werden sie einfach noch gebraucht, auch wenn man sie eigentlich überhaupt nicht leiden kann.. die Rede ist nicht von Frauen sondern natürlich von Tables. Im Zusammenhang mit Tables gibt es einiges zu wissen und kennen zu lernen. Neben den ganzen Elementen und Hierarchien, die man damit aufbauen kann, gibt es auch [...]]]></description>
			<content:encoded><![CDATA[<p>Und weiter geht&#8217;s..</p>
<p><a href="http://www.normansblog.de/tuerchen-11-empty-cells/"><img src="http://www.normansblog.de/wp-content/uploads/2010/11/adventskalender_11.png" alt="Türchen #11" title="Türchen #11" width="151" height="139" class="alignright size-full wp-image-2862" /></a> Manchmal werden sie einfach noch gebraucht, auch wenn man sie eigentlich überhaupt nicht leiden kann.. die Rede ist nicht von Frauen sondern natürlich von Tables. Im Zusammenhang mit Tables gibt es einiges zu wissen und kennen zu lernen. Neben den ganzen Elementen und Hierarchien, die man damit aufbauen kann, gibt es auch eine ganze Reihe von CSS Eigenschaften, die speziell Tables beeinflussen. Eine davon, nämlich <em>empty-cells</em>, stelle ich euch heute vor.</p>
<p><span id="more-3057"></span></p>
<h3>Browserunterstützung</h3>
<table class="acenter alignright">
<tr>
<td>Browser</td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/firefox_ico.png" alt="Firefox" title="Firefox" width="16" height="16" class="alignnone size-full wp-image-2887" /></td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/safari_ico.png" alt="Safari" title="Safari" width="16" height="16" class="alignnone size-full wp-image-2890" /></td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/opera_ico.png" alt="Opera" title="Opera" width="16" height="16" class="alignnone size-full wp-image-2889" /></td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/chrome_ico.png" alt="Chrome" title="Chrome" width="16" height="16" class="alignnone size-full wp-image-2886" /></td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/ie_ico.png" alt="Internet Explorer" title="Internet Explorer" width="16" height="16" class="alignnone size-full wp-image-2888" /></td>
</tr>
<tr>
<td>ab Version</td>
<td>1.0</td>
<td>1.2</td>
<td>4.0</td>
<td>1.0</td>
<td>8.0</td>
</tr>
</table>
<p>Eigentlich schon erstaunlich wie wenig der IE vor Version 8 überhaupt beherrscht hat, <code>empty-cells</code> hat jedenfalls nicht dazu gehört. Aber da es sich hier eh nur um eine kosmetische Eigenschaft geht, ist das noch vertretbar. Was macht <code>empty-cells</code>? Wie der Name schon andeutet, handelt es sich hier um Zellen einer Tabelle, die durch CSS ausgeblendet werden können, wenn sie leer sind.</p>
<p>Der dafür zuständige Wert lautet <code>hide</code>, um leere Zellen wieder anzuzeigen, muss der Wert auf <code>show</code> gestellt werden. <code>show</code> ist außerdem der Standardwert für <code>empty-cells</code>.</p>
<h3>Beispiel</h3>
<p>Schauen wir uns die Sache an einer Beispieltabelle an:</p>
<h6>HTML</h6>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">table</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">thead</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">tr</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">th</span>&gt;</span>Browser<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">th</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">th</span>&gt;</span>CSS3<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">th</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">tr</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">thead</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">tbody</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">tr</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;</span>Firefox<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;</span>ja<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">tr</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">tr</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;</span>Chrome<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;</span>ja<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">tr</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">tr</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;</span>IE<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">td</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">td</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">tr</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">tbody</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">table</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>(..jede Menge Tags, ich weiß..)<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span></pre></td></tr></table></div>

<h6>Ergebnis</h6>
<table style="border-collapse:separate;">
<thead>
<tr>
<th>Browser</th>
<th>CSS3</th>
</tr>
</thead>
<tbody>
<tr>
<td>Firefox</td>
<td>ja</td>
</tr>
<tr>
<td>Chrome</td>
<td>ja</td>
</tr>
<tr>
<td>IE</td>
<td></td>
</tr>
</tbody>
</table>
<p>Raus kommt eine normale Tabelle, eventuelle Borders und Hintergründe werden auch für leere Zellen gerendert, jetzt das Ganze mit <code>empty-cells:hide</code>.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">table <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">empty-cells</span><span style="color: #00AA00;">:</span><span style="color: #993333;">hide</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h6>Ergebnis</h6>
<table style="empty-cells:hide">
<thead>
<tr>
<th>Browser</th>
<th>CSS3</th>
</tr>
</thead>
<tbody>
<tr>
<td>Firefox</td>
<td>ja</td>
</tr>
<tr>
<td>Chrome</td>
<td>ja</td>
</tr>
<tr>
<td>IE</td>
<td></td>
</tr>
</tbody>
</table>
<p>Und weg ist die leere <code>td</code>! Naja nicht ganz weg, aber halt versteckt. Sie bleibt immer noch im Markup vorhanden und behält ihre Ausmaße. Man muss auch keine Angst haben, dass floatende Elemente in die Lücken rutschen oder sowas in der Art. <img src='https://www.normansblog.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>https://www.normansblog.de/tuerchen-11-empty-cells/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Türchen #10: negatives margin</title>
		<link>https://www.normansblog.de/tuerchen-10-negatives-margin/</link>
		<comments>https://www.normansblog.de/tuerchen-10-negatives-margin/#comments</comments>
		<pubDate>Fri, 10 Dec 2010 22:57:54 +0000</pubDate>
		<dc:creator>Norman</dc:creator>
				<category><![CDATA[Adventskalender 2010]]></category>
		<category><![CDATA[Anfänger]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.normansblog.de/?p=3041</guid>
		<description><![CDATA[Und weiter geht&#8217;s.. Komischer Weise hat sich so ein bisschen das Gerücht verbreitet, dass negative Werte für margin irgendwie falsch oder nicht standardkonform oder Cross-Browser-inkompatibel sein sollen. Das ist natürlich vollkommener Blödsinn, vor allem wenn man bedenkt, wie nützlich es sein kann, negative Werte zu benutzen. Ein Beispiel will ich euch gern zeigen. Browserunterstützung Browser [...]]]></description>
			<content:encoded><![CDATA[<p>Und weiter geht&#8217;s..</p>
<p><a href="http://www.normansblog.de/tuerchen-10-negatives-margin/"><img src="http://www.normansblog.de/wp-content/uploads/2010/11/adventskalender_10.png" alt="Türchen #10" title="Türchen #10" width="151" height="139" class="alignright size-full wp-image-2862" /></a> Komischer Weise hat sich so ein bisschen das Gerücht verbreitet, dass <em>negative Werte für margin</em> irgendwie falsch oder nicht standardkonform oder Cross-Browser-inkompatibel sein sollen. Das ist natürlich vollkommener Blödsinn, vor allem wenn man bedenkt, wie nützlich es sein kann, negative Werte zu benutzen. Ein Beispiel will ich euch gern zeigen.</p>
<p><span id="more-3041"></span></p>
<h3>Browserunterstützung</h3>
<table class="acenter alignright">
<tr>
<td>Browser</td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/firefox_ico.png" alt="Firefox" title="Firefox" width="16" height="16" class="alignnone size-full wp-image-2887" /></td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/safari_ico.png" alt="Safari" title="Safari" width="16" height="16" class="alignnone size-full wp-image-2890" /></td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/opera_ico.png" alt="Opera" title="Opera" width="16" height="16" class="alignnone size-full wp-image-2889" /></td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/chrome_ico.png" alt="Chrome" title="Chrome" width="16" height="16" class="alignnone size-full wp-image-2886" /></td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/ie_ico.png" alt="Internet Explorer" title="Internet Explorer" width="16" height="16" class="alignnone size-full wp-image-2888" /></td>
</tr>
<tr>
<td>ab Version</td>
<td>1.0</td>
<td>1.0</td>
<td>3.5</td>
<td>1.0</td>
<td>3.0</td>
</tr>
</table>
<p><code>margin</code> wird natürlich von allen Browsern seit jeher unterstützt, dazu zählt auch die Angabe von negativen Werten. Damit lässt sich allerhand machen und kann einen in so manch einer kniffligen Situation aus der Patsche helfen. Prinzipiell könnte man es vielleicht am ehesten mit <code>position:relative</code> vergleichen. Die Position bzw. die Ausmaße einen Blocks ändern sich.. aber wie immer lässt es sich am besten an einem Beispiel erklären.</p>
<h3>Beispiel</h3>
<p>Nehmen wir ein einfaches Widget mit einer Überschrift, innerhalb des Widgets gibt es eine Überschrift und Inhalt in irgendeiner Form. Natürlich soll der Inhalt einen gewissen Abstand zum Rand des Widgets haben, dafür nutzen wir logischerweise Padding. Die Überschrift allerdings, soll durch einen Hintergrund farblich hervorgehoben sein.. aber durch das Padding des Widgets entsteht jetzt links und rechts eine Lücke, was also tun?</p>
<p>Schauen wir uns das Ganze mal näher an:</p>
<h6>HTML</h6>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;widget&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h4</span>&gt;</span>Überschrift<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h4</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></td></tr></table></div>

<h6>CSS</h6>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.widget</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#aaa</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">10px</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">200px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
h4 <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#adf</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h6>Ergebnis</h6>
<div style="border:1px solid #aaa;padding:0 10px 10px;margin-bottom:10px;width:200px;">
<h4 style="background-color:#adf;padding:0 10px;">Überschrift</h4>
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
</div>
<p>Da haben wirs.. grottig diese blöde Lücke links und rechts &#8211; aber es gibt eine Lösung für dieses Problem: negatives Margin to the rescue!</p>
<h6>Überschrift bekommt negatives Margin</h6>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">h4 <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#adf</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">-10px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h6>Ergebnis</h6>
<div style="border:1px solid #aaa;padding:0 10px 10px;margin-bottom:10px;width:200px;">
<h4 style="background-color:#adf;padding:0 10px;margin:0 -10px;">Überschrift</h4>
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
</div>
<p>Ach schön. <img src='https://www.normansblog.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>https://www.normansblog.de/tuerchen-10-negatives-margin/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Türchen #9: display:inline-block</title>
		<link>https://www.normansblog.de/tuerchen-9-display-inline-block/</link>
		<comments>https://www.normansblog.de/tuerchen-9-display-inline-block/#comments</comments>
		<pubDate>Thu, 09 Dec 2010 13:55:06 +0000</pubDate>
		<dc:creator>Norman</dc:creator>
				<category><![CDATA[Adventskalender 2010]]></category>
		<category><![CDATA[Anfänger]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[IE6]]></category>

		<guid isPermaLink="false">http://www.normansblog.de/?p=3015</guid>
		<description><![CDATA[Nachholbedarf ist angesagt.. Am neunten Tag möchte ich euch display:inline-block näher bringen. display an sich dürfte ja allen bekannt sein.. es gibt (neben diversen anderen) display:none, display:block, display:inline und eben noch etwas dazwischen &#8211; inline-block. Wozu man das braucht und wobei es hilfreich sein kann, verrät euch der heutige Eintrag. Browserunterstützung Browser ab Version 3.0 [...]]]></description>
			<content:encoded><![CDATA[<p>Nachholbedarf ist angesagt..</p>
<p><a href="http://www.normansblog.de/tuerchen-9-display-inline-block/"><img src="http://www.normansblog.de/wp-content/uploads/2010/11/adventskalender_9.png" alt="Türchen #9" title="Türchen #9" width="151" height="139" class="alignright size-full wp-image-2862" /></a> Am neunten Tag möchte ich euch display:inline-block näher bringen. display an sich dürfte ja allen bekannt sein.. es gibt (neben <a href="https://developer.mozilla.org/en/CSS/display#Values">diversen anderen</a>) <em>display:none</em>, <em>display:block</em>, <em>display:inline</em> und eben noch etwas dazwischen &#8211; <em>inline-block</em>. Wozu man das braucht und wobei es hilfreich sein kann, verrät euch der heutige Eintrag.</p>
<p><span id="more-3015"></span></p>
<h3>Browserunterstützung</h3>
<table class="acenter alignright">
<tr>
<td>Browser</td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/firefox_ico.png" alt="Firefox" title="Firefox" width="16" height="16" class="alignnone size-full wp-image-2887" /></td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/safari_ico.png" alt="Safari" title="Safari" width="16" height="16" class="alignnone size-full wp-image-2890" /></td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/opera_ico.png" alt="Opera" title="Opera" width="16" height="16" class="alignnone size-full wp-image-2889" /></td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/chrome_ico.png" alt="Chrome" title="Chrome" width="16" height="16" class="alignnone size-full wp-image-2886" /></td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/ie_ico.png" alt="Internet Explorer" title="Internet Explorer" width="16" height="16" class="alignnone size-full wp-image-2888" /></td>
</tr>
<tr>
<td>ab Version</td>
<td>3.0</td>
<td>1.0</td>
<td>3.5</td>
<td>1.0</td>
<td>5.5</td>
</tr>
</table>
<p><code>inline-block</code> hat eine Weile gebraucht bis es sich flächendeckend bei allen Browsern durchgesetzt hat. Aktuelle Versionen unterstützen es problemlos, nur IE6 und 7 haben eine Einschränkung: Der Wert wird nur auf inline-Elemente korrekt angewendet.</p>
<p>Was ist nun der große Vorteil von Inline-Block-Elementen? Anders als Block-Elemente, welche standardmäßig auf die volle Breite des Elternelements aufgezogen, verhalten sich Inline-Block-Elemente wie Replaced Elements (das <code>img</code>-Tag wäre ein Beispiel dafür). D. h. dass sie in den Textfluss eingebunden bleiben aber dennoch dir Vorteile eines Block-Elements genießen. Dazu zählen unter anderem volle Unterstützung für Margin. Auf normale Inline-Elemente kann man beispielsweise kein Margin anwenden, das hat schlicht keinen Einfluss.</p>
<h3>Beispiel</h3>
<p>Oftmals wird inline-block eingesetzt, wenn man ein Grid &#8211; auf Deutsch &#8220;Gitter-Struktur&#8221; &#8211; aufbauen will, deren Zellen aufgrund ihres Inhalts eine unbekannte Höhe haben können. Nehmen wir an, wie hätten eine Liste mit sechs Elementen, diese wollen wir zu einem 3&times;2-Grid zusammenfügen.</p>
<h6>HTML</h6>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>1<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>2<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">br</span><span style="color: #66cc66;">/</span>&gt;</span>+<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>3<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>4<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>5<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>6<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span></pre></td></tr></table></div>

<p>Zunächst wollen wir das auf althergebrachte Art und Weise machen, mit <code>float</code>:</p>
<h6>CSS</h6>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">ul <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#aaa</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">30px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">list-style</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span><span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">10px</span> <span style="color: #933;">10px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">180px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
li <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#adf</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span><span style="color: #993333;">center</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">30px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h6>Ergebnis</h6>
<ul style="border:1px solid #aaa;color:#fff;font-size:30px;list-style:none;margin:0 0 10px;overflow:hidden;padding:0 10px 10px 0;text-align:center;width:180px;">
<li style="background:#adf;float:left;margin:10px 0 0 10px;padding:10px;width:30px;">1</li>
<li style="background:#adf;float:left;margin:10px 0 0 10px;padding:10px;width:30px;">2<br/>+</li>
<li style="background:#adf;float:left;margin:10px 0 0 10px;padding:10px;width:30px;">3</li>
<li style="background:#adf;float:left;margin:10px 0 0 10px;padding:10px;width:30px;">4</li>
<li style="background:#adf;float:left;margin:10px 0 0 10px;padding:10px;width:30px;">5</li>
<li style="background:#adf;float:left;margin:10px 0 0 10px;padding:10px;width:30px;">6</li>
</ul>
<p>Und da sehen wir auch schon das Problem dieser Lösung: Sobald ein Listenelement höher ist als die anderen, bringt es komplett die Reihenfolge durcheinander. Außerdem muss die Liste <em>gecleared</em> werden, da die Listenelemente <em>floaten</em>. Genau da hilft uns <code>inline-block</code> weiter, aber auch damit muss man zwei Dinge beachten.</p>
<ol>
<li>Dadurch, dass die Elemente nun Inline-Charakter haben, werden Zeilenumbrüche, Einrückungen und Leerzeichen im Code als zu einem Leerzeichen zusammengefasst. Um dem entgegen zu wirken, brauch man nur die <code>li</code>-Tags hintereinander zu schreiben.</li>
<li>Ein weiterer Nachteil des Inline-Charakters ist die Tatsache, dass jetzt das Vertical-Alignment greift. Wir müssen also <code>vertical-align:top</code> setzen, damit die Listenelemente nach oben hin bündig zueinander sind.</li>
</ol>
<h6>HTML</h6>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>1<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>2<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">br</span><span style="color: #66cc66;">/</span>&gt;</span>+<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>3<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>4<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>5<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>6<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span></pre></td></tr></table></div>

<h6>CSS</h6>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">ul <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#aaa</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">30px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">list-style</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
	<span style="color: #808080; font-style: italic;">/*overflow:hidden;*/</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">10px</span> <span style="color: #933;">10px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">180px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
li <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#adf</span><span style="color: #00AA00;">;</span>
	<span style="color: #808080; font-style: italic;">/*float:left;*/</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #3333ff;">:inline-</span>block<span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span><span style="color: #993333;">center</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">30px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">vertical-align</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h6>Ergebnis</h6>
<ul style="border:1px solid #aaa;color:#fff;font-size:30px;list-style:none;margin:0 0 10px;padding:0 10px 10px 0;width:181px;letter-spacing:-7px;">
<li style="background:#adf;display:inline-block;margin:10px 0 0 10px;padding:10px;text-align:center;width:30px;vertical-align:top;">1</li>
<li style="background:#adf;display:inline-block;margin:10px 0 0 10px;padding:10px;text-align:center;width:30px;vertical-align:top;">2<br/>+</li>
<li style="background:#adf;display:inline-block;margin:10px 0 0 10px;padding:10px;text-align:center;width:30px;vertical-align:top;">3</li>
<li style="background:#adf;display:inline-block;margin:10px 0 0 10px;padding:10px;text-align:center;width:30px;vertical-align:top;">4</li>
<li style="background:#adf;display:inline-block;margin:10px 0 0 10px;padding:10px;text-align:center;width:30px;vertical-align:top;">5</li>
<li style="background:#adf;display:inline-block;margin:10px 0 0 10px;padding:10px;text-align:center;width:30px;vertical-align:top;">6</li>
</ul>
<p>Somit hätten wir ein schönes Grid, das so umbricht, wie man es von einem Grid erwartet. To be continued..</p>
]]></content:encoded>
			<wfw:commentRss>https://www.normansblog.de/tuerchen-9-display-inline-block/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Türchen #8: white-space</title>
		<link>https://www.normansblog.de/tuerchen-8-white-space/</link>
		<comments>https://www.normansblog.de/tuerchen-8-white-space/#comments</comments>
		<pubDate>Wed, 08 Dec 2010 22:31:26 +0000</pubDate>
		<dc:creator>Norman</dc:creator>
				<category><![CDATA[Adventskalender 2010]]></category>
		<category><![CDATA[Anfänger]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.normansblog.de/?p=3002</guid>
		<description><![CDATA[Morgen. Tag acht des CSS-Adventskalenders, wie die Zeit vergeht. Heute im Angebot: white-space und wie und warum man es benutzt. Wie immer gibts ein aussagekräftiges Beispiel, wenn ihr allerdings noch ein besseres bzw. überzeugenderes parat habt, dann immer her damit! Und ja ich weiß, ich bin viel zu spät dran damit aber besser spät als.. [...]]]></description>
			<content:encoded><![CDATA[<p>Morgen.</p>
<p><a href="http://www.normansblog.de/tuerchen-8-white-space/"><img src="http://www.normansblog.de/wp-content/uploads/2010/11/adventskalender_8.png" alt="Türchen #8" title="Türchen #8" width="151" height="139" class="alignright size-full wp-image-2862" /></a> Tag acht des CSS-Adventskalenders, wie die Zeit vergeht. Heute im Angebot: <em>white-space</em> und wie und warum man es benutzt. Wie immer gibts ein aussagekräftiges Beispiel, wenn ihr allerdings noch ein besseres bzw.  überzeugenderes parat habt, dann immer her damit! Und ja ich weiß, ich bin viel zu spät dran damit aber besser spät als.. na ihr wisst schon.</p>
<p><span id="more-3002"></span></p>
<h3>Browserunterstützung</h3>
<table class="acenter alignright">
<tr>
<td>Browser</td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/firefox_ico.png" alt="Firefox" title="Firefox" width="16" height="16" class="alignnone size-full wp-image-2887" /></td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/safari_ico.png" alt="Safari" title="Safari" width="16" height="16" class="alignnone size-full wp-image-2890" /></td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/opera_ico.png" alt="Opera" title="Opera" width="16" height="16" class="alignnone size-full wp-image-2889" /></td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/chrome_ico.png" alt="Chrome" title="Chrome" width="16" height="16" class="alignnone size-full wp-image-2886" /></td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/ie_ico.png" alt="Internet Explorer" title="Internet Explorer" width="16" height="16" class="alignnone size-full wp-image-2888" /></td>
</tr>
<tr>
<td>ab Version</td>
<td>1.0</td>
<td>1.0</td>
<td>4.0</td>
<td>1.0</td>
<td>6.0</td>
</tr>
</table>
<p><code>white-space</code> hat im Laufe der Zeit einige neue mögliche Werte bekommen, uns geht es aber primär um den Wert <code>nowrap</code>, den jeder relevante Browser schon seit längerem unterstützt. <code>nowrap</code> ermöglicht es uns Zeilenumbrüche zu verhindern. D. h. egal was kommt, Text mit diesem Wert wird auf keinen Fall umgebrochen.</p>
<h3>Beispiel</h3>
<p>Am einfachsten kann man das durch ein Beispiel zeigen. Manchmal möchte man ein Element in eine Richtung <em>floaten</em> lassen und vergibt eine eher schmale Breite. Innerhalb des Elements steht meinetwegen eine Überschrift und ein Datum, da der Browser nicht weiß, dass es ein Datum ist, bricht er den Text aufgrund der Breite innerhalb des Datums um. Das sieht nicht schön aus, besser wäre es doch, wenn der Text nach der Überschrift umbrechen würde und das Datum zusammen bleibt.</p>
<h6>HTML</h6>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;widget&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h3</span>&gt;</span>Überschrift <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;datum&quot;</span>&gt;</span>8. Dezember 2010<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h3</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></td></tr></table></div>

<h6>CSS</h6>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.widget</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#eee</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#aaa</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">180px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h6>Ergebnis</h6>
<div style="background-color:#eee;border:1px solid #aaa;margin:0 0 10px;padding:10px;width:180px;">
<h3>Überschrift <span class="datum">8. Dezember 2010</span></h3>
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
</div>
<p>Wie ihr seht, bricht der Text erst nach der &#8220;8&#8243; um, somit wird das Datum auseinander gerissen. Um das zu vermeiden, geben wir jetzt der Klasse &#8220;datum&#8221; <code>white-space:nowrap</code>.</p>
<h6>CSS</h6>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.datum</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">white-space</span><span style="color: #00AA00;">:</span><span style="color: #993333;">nowrap</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h6>Ergebnis</h6>
<div style="background-color:#eee;border:1px solid #aaa;margin:0 0 10px;padding:10px;width:180px;">
<h3>Überschrift <span style="white-space:nowrap">8. Dezember 2010</span></h3>
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
</div>
<p>Und siehe da, das Datum bleibt als Ganzes erhalten und die Überschrift muss nun an anderer Stelle umbrechen. Mission accomplished. <img src='https://www.normansblog.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>https://www.normansblog.de/tuerchen-8-white-space/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Türchen #7: outline</title>
		<link>https://www.normansblog.de/tuerchen-7-outline/</link>
		<comments>https://www.normansblog.de/tuerchen-7-outline/#comments</comments>
		<pubDate>Tue, 07 Dec 2010 22:24:03 +0000</pubDate>
		<dc:creator>Norman</dc:creator>
				<category><![CDATA[Adventskalender 2010]]></category>
		<category><![CDATA[Anfänger]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.normansblog.de/?p=2989</guid>
		<description><![CDATA[Schönen guten Abend. Ich weiß, ich weiß.. ich hatte versprochen etwas pünktlicher zu werden und jetzt ist es später als je zuvor. Tut mir leid aber am Geburtstag meiner Mutter gibt es einfach andere Prioritäten als einen Artikel im Blog zu schreiben. Trotzdem will ich mir jetzt die Zeit nehmen und euch etwas über outline [...]]]></description>
			<content:encoded><![CDATA[<p>Schönen guten Abend.</p>
<p><a href="http://www.normansblog.de/tuerchen-7-outline/"><img src="http://www.normansblog.de/wp-content/uploads/2010/11/adventskalender_7.png" alt="Türchen #7" title="Türchen #7" width="151" height="139" class="alignright size-full wp-image-2862" /></a> Ich weiß, ich weiß.. ich hatte versprochen etwas pünktlicher zu werden und jetzt ist es später als je zuvor. Tut mir leid aber am Geburtstag meiner Mutter gibt es einfach andere Prioritäten als einen Artikel im Blog zu schreiben. <img src='https://www.normansblog.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Trotzdem will ich mir jetzt die Zeit nehmen und euch etwas über <em>outline</em> erzählen.</p>
<p><span id="more-2989"></span></p>
<h3>Browserunterstützung</h3>
<table class="acenter alignright">
<tr>
<td>Browser</td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/firefox_ico.png" alt="Firefox" title="Firefox" width="16" height="16" class="alignnone size-full wp-image-2887" /></td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/safari_ico.png" alt="Safari" title="Safari" width="16" height="16" class="alignnone size-full wp-image-2890" /></td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/opera_ico.png" alt="Opera" title="Opera" width="16" height="16" class="alignnone size-full wp-image-2889" /></td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/chrome_ico.png" alt="Chrome" title="Chrome" width="16" height="16" class="alignnone size-full wp-image-2886" /></td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/ie_ico.png" alt="Internet Explorer" title="Internet Explorer" width="16" height="16" class="alignnone size-full wp-image-2888" /></td>
</tr>
<tr>
<td>ab Version</td>
<td>1.5</td>
<td>1.2</td>
<td>7.0</td>
<td>1.0</td>
<td>8.0</td>
</tr>
</table>
<p>Wow, erst ab IE8 wird das unterstützt.. ich musste auch erst zwei mal hinsehen und auf einer zweiten Seite checken aber okay. <code>outline</code> gibt es prinzipiell aus einem Grund. Dieser eine Grund besteht darin, Elemente, die mit der Tastatur (meistens durch Drücken der Tabulator-Taste) sogenannten &#8220;Fokus&#8221; bekommen, hervorzuheben. Dies geschiet in der Regel durch eine gepunktete Linie, die um das Elemente gezogen wird. Im Prinzip handelt es sich dabei um eine Art Spezialfall von <code>border</code> Da nur klickbare Elemente Fokus bekommen, können wir durchaus outline dazu benutzen einen doppelten Border-Effekt für nicht-klickbare Elemente zu erstellen.</p>
<p>Leider ist <code>outline</code> um einiges restriktiver als es <code>border</code> ist. Es erlaubt nämlich nicht, nur bestimmte Seiten rendern zu lassen, sondern rendert immer alle vier Seiten. D. h. im Klartext: es gibt kein <code>outline-top/-right/-bottom/-left</code> sondern eben nur <code>outline</code>.</p>
<p>Das Werte<a href="http://de.wikipedia.org/wiki/Tupel">tripel</a> ist allerdings das Gleiche wie wir es von <code>border</code> her kennen:</p>
<ol>
<li><code>outline-width</code>, die Linienstärke &#8211; angegeben in irgendeiner Maßeinheit</li>
<li><code>outline-style</code>, ein Style-Schlüsselwort wie bspw. <em>dottet</em>, <em>solid</em>, <em>dashed</em> oder <em>groove</em></li>
<li><code>outline-color</code>, Farbe der Linie; wenn nicht angegeben, nimmt es (zumindest in Firefox) den Wert der Schriftfarbe an</li>
</ol>
<h3>Beispiele</h3>
<p>Wie oben schon erwähnt werden wir jetzt mal eine doppelte Border mit Hilfe von <code>outline</code> erstellen:</p>
<h6>CSS</h6>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.widget</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#eee</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#aaa</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">outline</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#888</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">200px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h6>Ergebnis</h6>
<div style="background-color:#eee;border:5px solid #aaa;padding:10px;outline:5px solid #888;margin:10px 0 20px;width:200px;">
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
</div>
<blockquote class="warning">
<p><strong>Aber Achtung:</strong> Outline zählt <em>nicht</em> zum Box-Model, das Margin fängt stets nach der Border an, Outline wird dabei ignoriert. Es hat damit auch keinen Einfluss auf den Gesamtfluss aller anderen Elemente.</p>
</blockquote>
<p>Ein weiteres Beispiel wäre einer Box oder einem Widget einen kleinen 3D-Effekt zu verpassen. Dazu hellt man die oberste Pixelreihe auf und dunkelt die anderen ab, um so die Box hervorzuheben.</p>
<h6>CSS</h6>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.box</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#adf</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#cff</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border-bottom</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#28a</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">outline</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#7ac</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">200px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h6>Ergebnis</h6>
<div style="background-color:#adf;border-top:1px solid #cff;border-bottom:1px solid #28a;padding:10px;outline:5px solid #7ac;margin:10px 0 20px;width:200px;">
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
</div>
<p>Ich geb&#8217;s ja zu.. man muss schon etwas genauer hinsehen. Aber solche Details sind es schließlich, die ein klasse Design von einem guten Design unterscheiden können. Und mit <code>outline</code> geht das ganz einfach ohne zusätzlichem Markup.</p>
<p>Ach und bevor ich wieder Mecker einstecken muss: Die durch Outline produzierte Border wird derzeit im Firefox nicht von <a href="http://www.normansblog.de/css3-im-detail-border-radius/">border-radius</a> abgerundet, bei anderen Browsern bin ich mir grad nicht sicher. Und ja, man kann eine doppelte Border auch mit <a href="http://www.normansblog.de/css3-im-detail-box-shadow/">box-shadow</a> herstellen aber das ist noch Cross-Browser-inkompatibler ( <img src='https://www.normansblog.de/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  ) als man mit <code>outline</code> schon ist.</p>
<p>Bis morgen dann. <img src='https://www.normansblog.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>https://www.normansblog.de/tuerchen-7-outline/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Türchen #6: overflow:hidden</title>
		<link>https://www.normansblog.de/tuerchen-6-overflow-hidden/</link>
		<comments>https://www.normansblog.de/tuerchen-6-overflow-hidden/#comments</comments>
		<pubDate>Mon, 06 Dec 2010 11:13:39 +0000</pubDate>
		<dc:creator>Norman</dc:creator>
				<category><![CDATA[Adventskalender 2010]]></category>
		<category><![CDATA[Anfänger]]></category>
		<category><![CDATA[Browser]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.normansblog.de/?p=2971</guid>
		<description><![CDATA[Guten Morgen und einen wohlgesinnten Nikolaus! Und, hattet ihr was leckeres in euren selbstverständlich geputzten Schuhen? Wenn nicht, gibts hier wieder etwas, was eure Laune eventuell anheben kann. Hinter Türchen Nummer sechs haben wir heute overflow:hidden, das viele im Zusammenhang mit Verstecken von Inhalt bzw. Scrollbalken kennen werden. Es gibt aber noch einen anderen Anwendungsfall&#8230; [...]]]></description>
			<content:encoded><![CDATA[<p>Guten Morgen und einen wohlgesinnten Nikolaus!</p>
<p><a href="http://www.normansblog.de/tuerchen-6-overflow-hidden/"><img src="http://www.normansblog.de/wp-content/uploads/2010/11/adventskalender_6.png" alt="Türchen #6" title="Türchen #6" width="151" height="139" class="alignright size-full wp-image-2862" /></a> Und, hattet ihr was leckeres in euren <em>selbstverständlich</em> geputzten Schuhen? Wenn nicht, gibts hier wieder etwas, was eure Laune eventuell anheben kann. Hinter Türchen Nummer sechs haben wir heute <em>overflow:hidden</em>, das viele im Zusammenhang mit Verstecken von Inhalt bzw. Scrollbalken kennen werden. Es gibt aber noch einen anderen Anwendungsfall&#8230;</p>
<p><span id="more-2971"></span></p>
<h3>Browserunterstützung</h3>
<table class="acenter alignright">
<tr>
<td>Browser</td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/firefox_ico.png" alt="Firefox" title="Firefox" width="16" height="16" class="alignnone size-full wp-image-2887" /></td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/safari_ico.png" alt="Safari" title="Safari" width="16" height="16" class="alignnone size-full wp-image-2890" /></td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/opera_ico.png" alt="Opera" title="Opera" width="16" height="16" class="alignnone size-full wp-image-2889" /></td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/chrome_ico.png" alt="Chrome" title="Chrome" width="16" height="16" class="alignnone size-full wp-image-2886" /></td>
<td><img src="http://www.normansblog.de/wp-content/uploads/2010/11/ie_ico.png" alt="Internet Explorer" title="Internet Explorer" width="16" height="16" class="alignnone size-full wp-image-2888" /></td>
</tr>
<tr>
<td>ab Version</td>
<td>1.0</td>
<td>1.1</td>
<td>4.0</td>
<td>1.0</td>
<td>4.0</td>
</tr>
</table>
<p>Die Eigenschaft <em>overflow</em> wird von allen Browsern beherrscht, im IE6 gibts allerdings ein kleines Problem, wenn der Wert <code>visible</code> gesetzt ist. Demnach vergrößert er das Element, damit der Inhalt hinein passt. Dadurch verhalten sich height/width wie min-height/min-width. Uns interessiert aber nur ganz speziell der Fall von <code>overflow:hidden</code> und da gibts keine Probleme.</p>
<p>Normalerweise setzt man diese Eigenschaft ja dazu ein, um überstehenden Text auszublenden oder um zu verhindern, dass Scrollbalken erscheinen. Ein schöner Nebeneffekt ist aber, dass Elemente mit <code>overflow:hidden</code> ihren gefloateten Inhalt &#8220;clearen&#8221;.</p>
<h3>Beispiele</h3>
<p>Am besten wir schauen uns das mal an einem Beispiel an. Folgender Aufbau: Ein Container hat eine nach links floatende Box als Inhalt. Dadurch fällt der Container in sich zusammen und alle nachrückenden Inhalte rücken nach oben.</p>
<h6>HTML</h6>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;container&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;box&quot;</span>&gt;</span>Box<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
	Container
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></td></tr></table></div>

<h6>CSS</h6>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.box</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h6>Ergebnis</h6>
<div style="background-color:#eee;border:1px solid #aaa;padding:10px;margin:10px 0;">
<div style="background-color:red;border:1px solid #000;float:left;height:100px;margin-right:10px;width:100px;">Box</div>
<p>	Container
</p></div>
<p>Seht ihr was ich meine? Das sieht doof aus und oftmals will man das gar nicht.</p>
<p style="clear:both;">Um das zu vermeiden, kann man jetzt dem nachrückenden Inhalt z. B. ein <code>clear:both</code> geben. Das löst zwar das Problem mit dem Text neben der Box, aber nicht die Höhe unseres Containers. Jetzt kommt aber <code>overflow:hidden</code> ins Spiel, das wir dem Container verpassen müssen:</p>
<h6>CSS</h6>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.container</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span><span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h6>Ergebnis</h6>
<div style="background-color:#eee;border:1px solid #aaa;padding:10px;margin:10px 0;overflow:hidden;">
<div style="background-color:red;border:1px solid #000;float:left;height:100px;margin-right:10px;width:100px;">Box</div>
<p>	Container
</p></div>
<p>Siehe da, alles bestens, die floatende Box wird wieder komplett vom Container umschlossen. Dabei brauchen wir nicht einmal zusätzliches Markup wie beispielsweise ein Clear-Div.</p>
<p>Short and simple, schönen Tag noch und bis morgen. <img src='https://www.normansblog.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>https://www.normansblog.de/tuerchen-6-overflow-hidden/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>CSS Einsteiger Tutorial #3</title>
		<link>https://www.normansblog.de/css-beginner-tutorial-3/</link>
		<comments>https://www.normansblog.de/css-beginner-tutorial-3/#comments</comments>
		<pubDate>Sun, 29 Mar 2009 16:50:39 +0000</pubDate>
		<dc:creator>Norman</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Anfänger]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.normansblog.de/?p=543</guid>
		<description><![CDATA[CSS Einsteiger Tutorial #3 Herzlich willkommen zum dritten Teil des CSS Einsteiger Tutorials. Es wird empfohlen folgende Teile des Tutorials vorher gelesen zu haben: Teil #1 (XHTML+CSS, Syntax) Teil #2 (Syntax, Selektoren, Box-Model) In Teil 3 werden wir versuchen ein zweispaltiges Layout &#8211; bestehend aus Header, Sidebar, Content und Footer &#8211; zu erstellen. Wieder mit [...]]]></description>
			<content:encoded><![CDATA[<h3>CSS Einsteiger Tutorial #3</h3>
<p><a href="https://www.normansblog.de/css-beginner-tutorial-3/"><img src="http://www.normansblog.de/wp-content/uploads/2009/03/css_part3.jpg" alt="css_part3" title="css_part3" width="100" height="98" class="alignright size-full wp-image-546" /></a>Herzlich willkommen zum dritten Teil des CSS Einsteiger Tutorials. Es wird empfohlen folgende Teile des Tutorials vorher gelesen zu haben:</p>
<ol>
<li><a href="https://www.normansblog.de/css-beginner-tutorial-1/">Teil #1 (XHTML+CSS, Syntax)</a></li>
<li><a href="https://www.normansblog.de/css-beginner-tutorial-2/">Teil #2 (Syntax, Selektoren, Box-Model)</a></li>
</ol>
<p>In Teil 3 werden wir versuchen ein zweispaltiges Layout &#8211; bestehend aus Header, Sidebar, Content und Footer &#8211; zu erstellen.</p>
<p><span id="more-543"></span></p>
<p>Wieder mit dabei?</p>
<blockquote><p>na aber sicher!</p></blockquote>
<p>Ok, bevor es richtig losgeht, sollte wir noch eine wichtige Unterscheidung von HTML-Elementen kennen und verstehen lernen.</p>
<h3>Block- &amp; Inline-Elemente</h3>
<h4>Block-Elemente</h4>
<p>Block-Elemente sind HTML-Elemente, die vom Browser so interpretiert werden, als würde vor und nach ihnen ein Zeilenumbruch stehen. Sie starten also, außer nicht anders durch CSS-Befehle festgelegt, eine neue Zeile. Standardmäßig bekommen Block-Elemente die gleiche Breite wie ihre Elternelemente, sie versuchen also ihr Elternelement in der Breite (nicht aber in der Höhe, die wiederum vom Inhalt bestimmt wird) auszufüllen.</p>
<p>Beispiele für Block-Elemente sind:</p>
<ul>
<li><code>div</code> &#8211; Divisions (Sektor)</li>
<li><code>p</code> &#8211; Paragraph (Absatz)</li>
<li><code>blockquote</code> &#8211; Blockquote (Zitat)</li>
<li><code>ul,ol</code> &#8211; Unordered/Ordered List (ungeordnete/geordnete Liste)</li>
<li><code>li</code> &#8211; List Item (Listenelement)</li>
<li><code>h1-6</code> &#8211; Headings (Überschriften)</li>
<li><code>table</code> &#8211; Table (Tabelle)</li>
</ul>
<h4>Inline-Elemente</h4>
<p>Inline-Elemente hingegen produzieren keine Zeilenumbrüche, sie werden einfach der Reihe nach dargestellt. Ihre Breite und Höhe wird von ihrem Inhalt bestimmt, unabhängig vom Elternelement (auch hier gilt wieder: nur solange nicht anders durch CSS-Befehle festgelegt).</p>
<p>Beispiele für Inline-Elemente sind:</p>
<ul>
<li><code>span</code> &#8211; Span</li>
<li><code>a</code> &#8211; Anchor (Link)</li>
<li><code>em</code> &#8211; Emphasize (Italic)</li>
<li><code>strong</code> &#8211; Strong (Fett)</li>
<li><code>code</code> &#8211; Code</li>
</ul>
<h4>Bemerkungen</h4>
<p>Ein Layout, und dazu zählt auch unseres, besteht aus Block-Elementen, die mit anderen Block- und Inline-Elementen gefüllt werden. (Sidebar bekommt eine Liste, Content wird mit Absätzen befüllt, die wiederum Links und Spans enthalten können usw.)</p>
<p>Jedes Element kann in seinem Verhalten verändert werden. Der CSS-Befehl, der dafür zuständig ist, heißt <code>display</code>. <code>display</code> hat mehrere Zustände; hier die 4 wichtigsten:</p>
<ol>
<li><code>none</code> das Element wird nicht angezeigt (Element + Inhalt verstecken)</li>
<li><code>inline</code> das Element wird als Inline-Element behandelt</li>
<li><code>block</code> das Element wird als Block-Element behandelt</li>
<li><code>list-item</code> das Element wird als Listenelement angezeigt (mit Anstrich)</li>
</ol>
<p>Jedes Block-Element kann somit als Inline-Element und umgedreht behandelt werden, wodurch man sehr flexibel wird was die Benutzung von Elementen angeht.</p>
<blockquote class="idea"><p>Durch das Ändern der <code>display</code>-Eigenschaft ändern wir <strong>nicht</strong> das Element selbst. Ein Block-Element bleibt ein Block-Element, es verhält sich nur anders. Es ist also auch damit nicht möglich ein <code>div</code> innerhalb eines <code>a</code>-Elements zu schreiben o.ä.!</p></blockquote>
<blockquote><p>das hab ich natürlich gleich gewusst.. <img src='https://www.normansblog.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p></blockquote>
<h3>Zweispaltiges Layout</h3>
<p>Ein Layout mit zwei Spalten besteht zumeist aus Header (Banner, Top-Navigation, Suche etc.), Sidebar (Navigation, Kalender, Werbung etc.), Content (der eigentliche Seiteninhalt, Bilder etc.) und dem Footer (Back-Links, Sitemap, Copyright etc.). Die meisten WordPress Themes &#8211; meins inklusive &#8211; benutzen ein zweispaltiges Layout, deshalb soll es uns hier mal als Beispiel dienen:</p>
<div id="attachment_551" class="wp-caption aligncenter" style="width: 520px"><img src="http://www.normansblog.de/wp-content/uploads/2009/03/site_parts.jpg" alt="Zweispaltiges Layout mit Header, Sidebar, Content und Footer." title="site_parts" width="500" height="425" class="size-full wp-image-551" /><p class="wp-caption-text">Zweispaltiges Layout mit Header, Sidebar, Content und Footer.</p></div>
<p>Alle markierten Blöcke auf dem Bild sind <code>div</code>s und somit Block-Elemente. Der HTML-Code für diese grobe Struktur würde wie folgt aussehen:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
	<span style="color: #808080; font-style: italic;">&lt;!-- meta Elemente, Verlinkung auf CSS Datei --&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;page&quot;</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;header&quot;</span>&gt;</span>
				Header
			<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;sidebar&quot;</span>&gt;</span>
				Sidebar
			<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;content&quot;</span>&gt;</span>
				Content
			<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;footer&quot;</span>&gt;</span>
				Footer
			<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></pre></td></tr></table></div>

<p>Die IDs sind dazu da, um die Elemente später per CSS anzusprechen. Das <code>div id="page"</code> ist praktisch, wenn wir unsere Seite zentrieren wollen. Oftmals wird so ein <code>div</code> auch <em>wrapper</em> genannt, weil es die Seite nochmal umschließt (eng: to wrap).</p>
<p>Wollen wir nun unseren Blöcken ein gewisses Aussehen verleihen und schreiben also folgende CSS (die Werte für <code>height</code> und <code>background-color</code> stehen nur da, damit wir nachher was sehen, normalerweise wird die Höhe vom Inhalt des jeweiligen Divs bestimmt):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>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
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">#<span style="color: #000000; font-weight: bold;">page</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* zentriert die Seite */</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">800px</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* Seite wird 800 Pixel breit */</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#header</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#00ffff</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">50px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#sidebar</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#ff8800</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">200px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
#<span style="color: #000000; font-weight: bold;">content</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#ff00ff</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">600px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">400px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#footer</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#00ff00</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">50px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Schauen wir uns nun das Ganze im Browser an:</p>
<div id="attachment_561" class="wp-caption aligncenter" style="width: 520px"><img src="http://www.normansblog.de/wp-content/uploads/2009/03/page_nofloat.jpg" alt="Zweispaltiges Layout? Noch nicht ganz.." title="page_nofloat" width="500" height="375" class="size-full wp-image-561" /><p class="wp-caption-text">Zweispaltiges Layout? Noch nicht ganz..</p></div>
<blockquote><p>hm.. da stimmt irgendwas noch nicht. sidebar und content sollten doch eigentlich nebeneinander passen?!</p></blockquote>
<p>Völlig richtig! Allerdings reicht dafür obenstehendes CSS nicht aus. Es gibt allerdings eine ganz einfache Methode, um unser Ziel zu erreichen &#8211; <code>float</code></p>
<h4>Float</h4>
<p><code>float</code> hat 3 wichtige Zustände:</p>
<ol>
<li><code>left</code> Element &#8220;fließt&#8221; nach links</li>
<li><code>right</code> Element &#8220;fließt&#8221; nach rechts</li>
<li><code>none</code> Element &#8220;fließt&#8221; nicht</li>
</ol>
<blockquote><p>öhm.. &#8220;fließt&#8221; ??</p></blockquote>
<p>Um es verständlicher zu machen, erkläre ich es am besten an einem Beispiel. Folgendes Szenario: Eine große 500px breite Box (schwarzer Rahmen) soll mit 4 Boxen (Box1-4) befüllt werden, die alle die Eigenschaft <code>float:left</code> besitzen und jeweils eine unterschiedliche Höhe und Breite haben.</p>
<p>Gehen wir die Sache Schritt für Schritt durch..</p>
<p>1. Box1 platziert sich wie erwartet links oben.</p>
<div id="attachment_566" class="wp-caption aligncenter" style="width: 522px"><img src="http://www.normansblog.de/wp-content/uploads/2009/03/boxes1.jpg" alt="Box1" title="boxes1" width="502" height="277" class="size-full wp-image-566" /><p class="wp-caption-text">Bild 1</p></div>
<p>2. Box2 &#8220;fließt&#8221; jetzt links neben Box1, da noch genug Platz vorhanden ist.</p>
<div id="attachment_567" class="wp-caption aligncenter" style="width: 522px"><img src="http://www.normansblog.de/wp-content/uploads/2009/03/boxes2.jpg" alt="Box2" title="boxes2" width="502" height="277" class="size-full wp-image-567" /><p class="wp-caption-text">Bild 2</p></div>
<p>3. Box3 tut es Box2 gleich.</p>
<div id="attachment_568" class="wp-caption aligncenter" style="width: 522px"><img src="http://www.normansblog.de/wp-content/uploads/2009/03/boxes3.jpg" alt="Box3" title="boxes3" width="502" height="277" class="size-full wp-image-568" /><p class="wp-caption-text">Bild 3</p></div>
<p>4. Die &#8220;erste Reihe&#8221; ist nun voll Box4 muss sich weiter unten einreihen, wir sehen jedoch das Problem. Box4 lässt nach links Platz weil es ja auch soweit wie möglich nach oben will und muss.</p>
<div id="attachment_569" class="wp-caption aligncenter" style="width: 522px"><img src="http://www.normansblog.de/wp-content/uploads/2009/03/boxes4.jpg" alt="Box4" title="boxes4" width="502" height="277" class="size-full wp-image-569" /><p class="wp-caption-text">Bild 4</p></div>
<p>5. Um das zu verhindern und Box4 auf einer &#8220;neuen Zeile&#8221; beginnen zu lassen, fügen wir <strong>vor</strong> Box4 noch eine weiter Box hinzu.</p>
<div id="attachment_570" class="wp-caption aligncenter" style="width: 522px"><img src="http://www.normansblog.de/wp-content/uploads/2009/03/boxes5.jpg" alt="Bild 5" title="boxes5" width="502" height="277" class="size-full wp-image-570" /><p class="wp-caption-text">Bild 5</p></div>
<p>CSS-Code für Box5:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.box5</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span><span style="color: #993333;">both</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Damit ist Box5 ein sogenannter Clear-Div. Solche Divs bewirken, dass nachfolgende Elemente das Floating von vorhergehenden Elementen ignorieren und somit wieder &#8220;bei Null angfangen&#8221;, d.h. sich wieder ganz links anordnen und nicht solche Fehler produzieren wie in Bild 4.</p>
<blockquote class="idea"><p>Neben <code>both</code> hat <code>clear</code> noch die Werte <code>left</code> und <code>right</code>, sodass es möglich ist nur eine bestimmte <code>float</code>-Richtung aufzuheben. Außerdem ist <code>clear</code> nicht auf Divs beschränkt sondern kann auf jedes Element angewendet werden.</p></blockquote>
<blockquote><p>Ok, ich denke ich hab&#8217;s verstanden.. zurück zu unserem Beispiel, was muss ich da nun wo ändern?</p></blockquote>
<p>Mit dem neuen Wissen lassen wir nun die Sidebar und den Content floaten. Die Sidebar nach links und den Content nach rechts. So können wir sicher sein, dass nichts schief läuft. Zusätzlich sollten wir dem Footer noch ein <code>clear:both</code> verpassen, das ist zwar nicht unbedingt notwendig aber sollten wir doch aus irgendwelchen gründen noch Elemente nach dem Footer einfügen und diese floaten lassen besteht die Gefahr, dass es uns das Layout zerschießt.</p>
<p>Der neue CSS-Code lautet demnach (nur #sidebar, #content und #footer ändern sich, Rest bleibt gleich):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#sidebar</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#ff8800</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">200px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
#<span style="color: #000000; font-weight: bold;">content</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#ff00ff</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">600px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">400px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#footer</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span><span style="color: #993333;">both</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#00ff00</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">50px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Und siehe da, alles so wie es sein soll <img src='https://www.normansblog.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div id="attachment_573" class="wp-caption aligncenter" style="width: 520px"><img src="http://www.normansblog.de/wp-content/uploads/2009/03/page_float.jpg" alt="Sieht es bei dir auch so aus? Dann glückwunsch zum einem zweispaltigen Layout!" title="page_float" width="500" height="313" class="size-full wp-image-573" /><p class="wp-caption-text">Sieht es bei dir auch so aus? Dann Glückwunsch zum einem zweispaltigen Layout!</p></div>
<blockquote><p>Sehr geil.</p></blockquote>
<p>Nun kannst du anfangen die Blöcke mit Inhalt zu befüllen! Folgende Teile stehen zum Weiterlesen bereit:</p>
<ol>
<li><a href="https://www.normansblog.de/css-beginner-tutorial-1/">Teil #1 (XHTML+CSS, Syntax)</a></li>
<li><a href="https://www.normansblog.de/css-beginner-tutorial-2/">Teil #2 (Syntax, Selektoren, Box-Model)</a></li>
<li>Teil #3 (Zweispaltiges Layout, Float)</li>
</ol>
<blockquote class="idea"><p>War dieses Tutorial hilfreich? Was möchtest du als nächstes wissen? Hast du Fehler gefunden oder etwas vermisst? Dann hinterlasse einfach einen Kommentar <img src='https://www.normansblog.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p></blockquote>
]]></content:encoded>
			<wfw:commentRss>https://www.normansblog.de/css-beginner-tutorial-3/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>CSS Einsteiger Tutorial #2</title>
		<link>https://www.normansblog.de/css-beginner-tutorial-2/</link>
		<comments>https://www.normansblog.de/css-beginner-tutorial-2/#comments</comments>
		<pubDate>Sat, 31 Jan 2009 02:19:08 +0000</pubDate>
		<dc:creator>Norman</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Anfänger]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.normansblog.de/?p=344</guid>
		<description><![CDATA[CSS Einsteiger Tutorial #2 Herzlich willkommen zum zweiten Teil des CSS Einsteiger Tutorials. Es wird empfohlen folgende Teile des Tutorials vorher gelesen zu haben: Teil #1 (XHTML+CSS, Syntax) In diesem Teil werden wir noch mehr Möglichkeiten zum Ansprechen von HTML Elementen kennen lernen. Das kleine Layout muss bis Teil3 warten, da Teil 2 etwas größer [...]]]></description>
			<content:encoded><![CDATA[<h3>CSS Einsteiger Tutorial #2</h3>
<p><a href="https://www.normansblog.de/css-beginner-tutorial-2"><img src="http://www.normansblog.de/wp-content/uploads/2009/01/css_part2.jpg" alt="css_part2" title="css_part2" width="100" height="98" class="alignright size-full wp-image-362" /></a>Herzlich willkommen zum zweiten Teil des CSS Einsteiger Tutorials. Es wird empfohlen folgende Teile des Tutorials vorher gelesen zu haben:</p>
<ol>
<li><a href="https://www.normansblog.de/css-beginner-tutorial-1/">Teil #1 (XHTML+CSS, Syntax)</a></li>
</ol>
<p>In diesem Teil werden wir noch mehr Möglichkeiten zum Ansprechen von HTML Elementen kennen lernen. Das kleine Layout muss bis Teil3 warten, da Teil 2 etwas größer als geplant geworden ist. <img src='https://www.normansblog.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span id="more-344"></span></p>
<p>Bist du wieder mit dabei?</p>
<blockquote><p>logisch *Kippe ausmach* *anschnall*</p></blockquote>
<p>Gut, dann können wir ja anfangen..</p>
<h3>Syntax (Weiterführung)</h3>
<h4>Kommentare</h4>
<p>In CSS ist es möglich und auch sinnvoll Kommentare zu setzen. Ähnlich wie in C/C++ werden sie folgendermaßen gekennzeichnet:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* Kommentar */</span></pre></td></tr></table></div>

<p>Solche Kommentare können auch über mehrere Zeilen verlaufen:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* Kommentar,
der über mehrere
Zeilen verläuft */</span></pre></td></tr></table></div>

<p>Es ist gut Überschriften innerhalb der CSS Datei per Kommentar zu setzen, um so eine gewisse Struktur aufzubauen. Weiter gehts! <img src='https://www.normansblog.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h4>Selektoren</h4>
<p>In Teil 1 haben wir die Grundstruktur von CSS Regeln kennen gelernt, hier nochmal der Aufbau:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="css" style="font-family:monospace;">Selektor <span style="color: #00AA00;">&#123;</span>
	Property-A<span style="color: #00AA00;">:</span> Value-A<span style="color: #00AA00;">;</span>
	Property-B<span style="color: #00AA00;">:</span> Value-B<span style="color: #00AA00;">;</span>
	...
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>In unserem letzten Beispiel war der Selektor ein <code>p</code>-Tag bzw. ein <code>p</code>-Tag mit der Klasse <code>absatz</code>. Es gibt jedoch noch eine ganze Menge anderer Selektoren und Art und Weisen, wie man diese klug einsetzen kann.</p>
<p>Folgende Tabelle gibt einen Überblick über alle möglichen Selektoren (Quelle: <a href="http://de.wikipedia.org/wiki/Cascading_Style_Sheets#Definition_des_Syntaxschemas">Wikipedia</a>)</p>
<table>
<tr>
<th>Muster</th>
<th>Bedeutung</th>
</tr>
<tr>
<td>*</td>
<td>Selektiert jedes Element (&#8220;universal selector&#8221;)</td>
</tr>
<tr>
<td>E</td>
<td>Selektiert jedes Element vom Typ E (jedes <code>E</code>-Tag)</td>
</tr>
<tr>
<td>.c</td>
<td>Selektiert jedes Element der Klasse c (analog [class~='c'])</td>
</tr>
<tr>
<td>#myid</td>
<td>Selektiert das Element mit der ID &#8220;myid&#8221;</td>
</tr>
<tr>
<td>E[foo]</td>
<td>Selektiert jedes Element E, bei dem das „foo“-Attribut gesetzt ist (unabhängig vom Wert)</td>
</tr>
<tr>
<td>E[foo=bar]</td>
<td>Selektiert jedes Element E, bei dem das „foo“-Attribut mit dem Wert bar gesetzt ist</td>
</tr>
<tr>
<td>E[foo^=bar]</td>
<td>Selektiert jedes Element E, bei dem das „foo“-Attribut mit dem Wert bar beginnt</td>
</tr>
<tr>
<td>E[foo$=bar]</td>
<td>Selektiert jedes Element E, bei dem das „foo“-Attribut mit dem Wert bar endet</td>
</tr>
<tr>
<td>E[foo*=bar]</td>
<td>Selektiert jedes Element E, bei dem das „foo“-Attribut den Wert bar enthält</td>
</tr>
<tr>
<td>E.c</td>
<td>Selektiert jedes Element E der Klasse c</td>
</tr>
<tr>
<td>E F</td>
<td>Selektiert jedes Element F, das ein Nachfahre von Element E ist</td>
</tr>
<tr>
<td>E > F</td>
<td>Selektiert jedes Element F, das ein Kind von E ist</td>
</tr>
<tr>
<td>E ~ F</td>
<td>Selektiert jedes Element F, das einen Vorgänger E auf gleicher Ebene hat</td>
</tr>
<tr>
<td>E + F</td>
<td>Selektiert jedes Element F, das einen direkten Vorgänger E auf gleicher Ebene hat</td>
</tr>
</table>
<blockquote class="warning"><p>IE6 unterstützt keine Attribut-Selektoren.<br/>Versuche einfach andere Selektoren zu benutzen (Klassen- oder ID-Selektoren) oder dein HTML entsprechend dahingehend zu ändern.</p></blockquote>
<blockquote><p>boar.. das sind jetzt aber ganz schön viele, muss ich die alle auswendig wissen?!</p></blockquote>
<p>Nein. Es kann zwar nicht schaden sie alle zu wissen, in der Regel reicht es aber gehört zu haben, dass es sowas gibt und dann an entsprechender Stelle nachzuschlagen. Du wirst schnell merken, welche in der Praxis wichtig und welche weniger wichtig sind.</p>
<p>In unserem Beispielabsatz aus Teil 1 haben wir den Selektor <code>p.absatz</code> benutzt, der sagt, dass alle <code>p</code>-Tags der Klasse <code>absatz</code> von den darauffolgenden Properties betroffen sind. Was ist aber, wenn wir auch andere Elemente wie <code>div</code> oder <code>blockquote</code> so aussehen lassen wollen?</p>
<p>Dieses Problem lösen wir einfach, indem wir das <code>p</code> in unserem Selektor weglassen. Dann bleibt nur <code>.absatz</code> übrig. Genau dieser Ausdruck sagt, &#8220;nimm alle Elemente der Klasse <code>absatz</code> und style sie wie folgt..&#8221;. Es werden also alle Elemente, egal ob <code>p</code>, <code>div</code> oder <code>blockquote</code> gestylt, solange sie die entsprechende Klasse besitzen.</p>
<p>Dasselbe gilt natürlich auch für IDs, welche übrigens mit einem Nummernkreuz/Raute <code>#</code> statt einem Punkt angesprochen werden.</p>
<blockquote><p>Was ist denn überhaupt der Unterschied zwischen <code>class</code> und <code>id</code>?</p></blockquote>
<p>Das ist ganz einfach: Elemente mit einer Klasse können beliebig oft innerhalb des HTML Dokuments auftauchen.. zum Beispiel  könnte ein Text aus mehreren Absätzen bestehen, alle <code>p</code>-Tags könnten dann die Klasse <code>absatz</code> haben. Wenn wir jedoch IDs vergeben, so dürfen diese nur einmalig innerhalb des Dokuments sein. Zum Beispiel wird es auf einer Seite nur genau einen Header geben, deswegen können wir diesem eine ID geben.</p>
<blockquote class="idea"><p>Merke:<br/>id = einmalig<br/>class = beliebig oft</p></blockquote>
<blockquote><p>OK, merk ich mir.. sonst noch was?</p></blockquote>
<p>Ja, es kann vorkommen, dass wir einem Element zwei Klassen geben wollen oder müssen. Sowas ist der Fall, wenn wir zum Beispiel mehrere Absätze haben, diese aber unterschiedlich gestylt werden sollen:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;important&quot;</span>&gt;</span>Ich bin ein wichtiger Text und deshalb fett geschrieben<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;warning &quot;</span>&gt;</span>Ich bin eine Warnung, deshalb rot geschrieben.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;warning important&quot;</span>&gt;</span>Ich bin eine wichtige Warnung und deshalb rot und fett geschrieben.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span></pre></td></tr></table></div>

<p>der dazugehörige CSS Code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.important</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.warning</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#FF0000</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Wir sehen, dass der letzte Absatz zwei Klassen bekommen hat, indem wir einfach zwei Bezeichnungen innerhalb des <code>class</code>-Attributes angegeben haben. Damit bekommt er auch die Eigenschaften beider Klassen verliehen.</p>
<p>Wollen wir jetzt aber &#8211; aus welchem Grund auch immer &#8211; den dritten Absatz noch weitere besondere Eigenschaften geben, müssen wir unseren CSS Code noch erweitern und folgendes hinzufügen:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.important</span><span style="color: #6666ff;">.warning</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #808080; font-style: italic;">/* jetzt folgen die besonderen Eigenschaften */</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Du siehst, durch einfaches Aneinandersetzen zweier Klassennamen sprechen wir ausschließlich Elemente an, die beide Klassen besitzen. Die Reihenfolge spielt hierbei keine Rolle (<code>.warning.important</code> wäre also auch möglich).</p>
<h4>Pseudo-Klassen und -Elemente</h4>
<p>Folgende Tabelle zeigt alle Pseudo-Klassen auf:</p>
<table>
<tr>
<th>Muster</th>
<th>Bedeutung</th>
</tr>
<tr>
<td>:link</td>
<td>Beschreibt, wie unbesuchte Links aussehen</td>
</tr>
<tr>
<td>:visited</td>
<td>Beschreibt, wie bereits besuchte Links aussehen</td>
</tr>
<tr>
<td>:hover</td>
<td>Beschreibt, wie Links aussehen, wenn man mit der Maus drüber fährt</td>
</tr>
<tr>
<td>:active</td>
<td>Beschreibt, wie Links aussehen, wenn man sie gedrückt hält</td>
</tr>
<tr>
<td>:first-child</td>
<td>Selektiert das erste Kindelement des davorstehenden Elements</td>
</tr>
</table>
<blockquote class="warning"><p>IE6 unterstützt Pseudo-Klassen nur für <code>a</code>-Tags. Im IE7 treten keinerlei Probleme auf und Pseudo-Klassen sind für alle Tags nutzbar.</p></blockquote>
<p>Pseudo-Klassen stehen immer direkt hinter dem Selektor:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">a<span style="color: #3333ff;">:link </span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#0000FF</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
a<span style="color: #3333ff;">:visited </span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#00FF00</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
a<span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#FF0000</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
a<span style="color: #3333ff;">:active </span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#FF0000</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Dies bedeutet, dass unbesuchte Links Blau, besuchte Rot und Links, über denen die Maus &#8220;schwebt&#8221; bzw. gerade aktiv sind, Grün dargestellt werden. Die Reihenfolge dieser vier Pseudo-Klassen ist übrigens empfehlenswert (LVHA-Regel).</p>
<p>Und nun die Pseudo-Elemente:</p>
<table>
<tr>
<th>Muster</th>
<th>Bedeutung</th>
</tr>
<tr>
<td>:first-line</td>
<td>Selektiert die erste Zeile (meistens bei Absätzen genutzt)</td>
</tr>
<tr>
<td>:first-letter</td>
<td>Selektiert den ersten Buchstaben (Absätze oder <code>span</code>s)</td>
</tr>
<tr>
<td>:before</td>
<td>Fügt vor dem Element etwas hinzu</td>
</tr>
<tr>
<td>:after</td>
<td>Fügt nach dem Element etwas hinzu</td>
</tr>
</table>
<p>Pseudo-Elemente werden recht selten genutzt, können aber hier und da die Arbeit erleichtern. Nehmen wir an, wir möchten den ersten Buchstabe eines Kapitels (<a href="http://de.wikipedia.org/wiki/Initiale">Initiale</a>) besonders hervorheben. Anstatt den ersten Buchstabe in ein extra <code>span</code>-Tag zu schreiben, lassen wir das doch CSS für uns machen:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">p<span style="color: #6666ff;">.lead</span><span style="color: #3333ff;">:firstletter </span><span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#FF0000</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Damit wird der erste Buchstabe in 20px Schriftgröße und in der Farbe Rot dargestellt.</p>
<p>Okay damit hätten wir die Selektoren abgeschlossen, es kann nun aber vorkommen, dass beim Zusammenführen von mehreren Style Sheets Selektoren doppelt auftreten, aber unterschiedliche Properties haben:</p>
<p>1. CSS Datei</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">p<span style="color: #6666ff;">.lead</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#000000</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>2. CSS Datei</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">p<span style="color: #6666ff;">.lead</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#444444</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Wird der Text nun schwarz (oben) oder grau (unten) dargestellt? Je nachdem welche Datei als letztes eingebunden wurde. In diesem Fall soll das mal die zweite Datei sein, der Text würde also grau werden. Wollen wir aber, dass der Text dennoch schwarz sein soll, müssen wir ein <code>!important</code> zwischen Value und Semikolon schreiben:</p>
<p>modifizierte 1. CSS Datei</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">p<span style="color: #6666ff;">.lead</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#000000</span> !important<span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<blockquote><p>Könnte mal nützlich sein!</p></blockquote>
<h4>Hierarchische Verschachtelung</h4>
<p>Wir wissen ja, dass unsere HTML Datei eine Struktur hat. Das <code>html</code>-Tag hat die Kind-Elemente <code>head</code> und <code>body</code>. <code>body</code> hat wiederum viele andere Kind-Elemente wie <code>div</code>s, <code>p</code>s oder Überschriften (<code>h1-h6</code>). Sogar Elemente wie <code>p</code> können noch Kind-Elemente haben (z.B. <code>span</code>) &#8211; eine Hierarchie entsteht.</p>
<p>Nehmen wir an, wir haben einen <code>div</code> mit der ID &#8220;content&#8221; und dort sind zwei <code>p</code>-Tags enthalten. Einer davon ist die Einleitung (<code>class="lead"</code>) und soll deshalb fett dargestellt werden, der andere ist ein normaler Absatz:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;content&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;lead&quot;</span>&gt;</span>Ich bin die Einleitung und deshalb fett. *freu*<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Ich bin nur ein stinknormaler Absatz. *sad*<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></td></tr></table></div>

<p>Wollen wir jetzt diesen Einleitungsabsatz innerhalb des Inhalts-Divs ansprechen, gilt:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">#<span style="color: #000000; font-weight: bold;">content</span> p<span style="color: #6666ff;">.lead</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Zwischen Eltern- und Kindelement steht also nur ein Leerzeichen.</p>
<p>Und eine letzte Anmerkung zu dem Thema: <strong>Gruppieren von Selektoren</strong>. Es ist möglich und äußerst praktisch Elemente, die gleich aussehen sollen zu einer Gruppe zusammen zu fassen. Dazu werden die Elemente bzw. die einzelnen Selektoren mit einem Komma verkettet. Als Beispiel nehmen wir den Einleitungsabsatz von eben und die Warnung von weiter oben, beide sollen fett dargestellt werden:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">#<span style="color: #000000; font-weight: bold;">content</span> p<span style="color: #6666ff;">.lead</span><span style="color: #00AA00;">,</span> <span style="color: #6666ff;">.important</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Ziemlich simple Angelegenheit, oder? <img src='https://www.normansblog.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<blockquote><p>Joa.. glaub schon, was kommt als nächstes?</p></blockquote>
<p>Leider schafft es das Layout nicht mehr in diesen Teil des Tutorials aber dafür folgt schon mal ein kleiner Ausblick, indem wir einen Blick auf das Box-Model werfen.</p>
<h3>Box-Model</h3>
<p>Alle Elemente werden unter CSS als Box aufgefasst. Also als etwas, dass befüllt werden kann (mit Text z.B.). Eine Box kann eine Breite und Höhe haben, die sich in der Regel nach der Größe des Inhalts und der Größe des Elternelements richtet. Dazu kann noch kommen: Padding, Border und Margin.</p>
<p>Um das zu verdeutlichen, hier mal eine Grafik:</p>
<div id="attachment_361" class="wp-caption aligncenter" style="width: 500px"><img src="http://www.normansblog.de/wp-content/uploads/2009/01/w3c_box_model.jpg" alt="Das offizielle W3C Boxmodel mit Padding, Border und Margin." title="w3c_box_model" width="480" height="371" class="size-full wp-image-361" /><p class="wp-caption-text">Das offizielle W3C Boxmodel mit Padding, Border und Margin.</p></div>
<p>Diese Eigenschaften kann also jedes Element bekommen, einige haben schon standardmäßig welche. Überschriften haben z.B. ein Margin, damit sie etwas Abstand zu umliegenden Elementen haben und somit besser hervorstechen.</p>
<p><code>margin</code> und <code>padding</code> können <strong>vier</strong> Values haben, jeder dieser Values steht für eine Seite (top right bottom left (im Uhrzeigersinn, mit top gehts immer los)). Die anderen vier Properties können immer nur ein Value besitzen.</p>
<p>Ein Beispiel: Wir haben ein <code>span</code>-Tag, welches 10 Pixel Padding an allen Seiten bekommen soll.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;padding&quot;</span>&gt;</span>Ich bin ein span mit Padding.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span></pre></td></tr></table></div>

<p>CSS:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">span<span style="color: #6666ff;">.padding</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">padding-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Ich habe hier die einzelnen Properties für jede Seite benutzt und 10px als Value übergeben. Es geht aber noch kürzer:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">span<span style="color: #6666ff;">.padding</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span> <span style="color: #933;">10px</span> <span style="color: #933;">10px</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Diese Form ist äquivalent zu der darüber. Aber es geht sogar <strong>noch kürzer</strong>!</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">span<span style="color: #6666ff;">.padding</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<blockquote><p>WTF..?!</p></blockquote>
<p>Durch das Weglassen der drei anderen Values, nimmt der Browser einfach an, man möchte auf allen Seiten dasselbe Padding haben. Recht hat er und wir haben einen schlanken Code.</p>
<p>Nur.. was machen wir, wenn wir nur oben und unten Padding haben möchten und links und rechts lieber keinen, weil das vielleicht doof aussieht? Dann nehmen wir zwei Values, das erste regelt die Werte für oben und unten, das andere für die rechts und links:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">span<span style="color: #6666ff;">.padding</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<blockquote><p>Und wann brauchen wir 3 Values?</p></blockquote>
<p>Drei Values brauchen wir, wenn wir auf zwei Seiten, die sich gegenüber liegen, einen gleichen Wert haben wollen und auf den andern beiden Seiten unterschiedliche Werte brauchen:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">span<span style="color: #6666ff;">.padding</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span> <span style="color: #933;">0px</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Bedeutet:<br/><code>padding-top</code>: 10px<br/><code>padding-right</code>: 0px<br/><code>padding-bottom</code>: 5px<br/><code>padding-left</code> ist leer, bekommt aber einfach den Wert von <code>padding-right</code> (also auch 0 Pixel)</p>
<p>Puh.. ist mehr geworden als gedacht, deswegen gibts das Layoutbeispiel erst im nächsten Teil, bis dahin viel Spaß mit den Selektoren! Folgende Teile stehen zum Weiterlesen bereit:</p>
<ol>
<li><a href="https://www.normansblog.de/css-beginner-tutorial-1/">Teil #1 (XHTML+CSS, Syntax)</a></li>
<li>Teil #2 (Syntax, Selektoren, Box-Model)</li>
<li><a href="https://www.normansblog.de/css-beginner-tutorial-3/">Teil #3 (Zweispaltiges Layout, Float)</a></li>
</ol>
<blockquote class="idea"><p>War dieses Tutorial hilfreich? Hast du Fehler gefunden oder etwas vermisst? Dann hinterlasse einfach einen Kommentar <img src='https://www.normansblog.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p></blockquote>
]]></content:encoded>
			<wfw:commentRss>https://www.normansblog.de/css-beginner-tutorial-2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>CSS Einsteiger Tutorial #1</title>
		<link>https://www.normansblog.de/css-beginner-tutorial-1/</link>
		<comments>https://www.normansblog.de/css-beginner-tutorial-1/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 23:06:14 +0000</pubDate>
		<dc:creator>Norman</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Anfänger]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.normansblog.de/?p=276</guid>
		<description><![CDATA[CSS Einsteiger Tutorial #1 Herzlich willkommen zum ersten Teil meines großen CSS Einsteiger Tutorials. Ziel des Tutorials soll sein: Ich will absoluten Neulingen, die noch nie etwas von CSS gehört haben, die Grundlagen und den sauberen Gebrauch von CSS näher bringen. Jeder Teil wird dabei etwas anspruchsvoller sein und es wird tiefer in die Materie [...]]]></description>
			<content:encoded><![CDATA[<h3>CSS Einsteiger Tutorial #1</h3>
<p><a href="https://www.normansblog.de/css-beginner-tutorial-1"><img src="http://www.normansblog.de/wp-content/uploads/2009/01/css_part1.jpg" alt="css_part1" title="css_part1" width="100" height="98" class="alignright size-full wp-image-277" /></a>Herzlich willkommen zum ersten Teil meines großen CSS Einsteiger Tutorials.</p>
<p><strong>Ziel des Tutorials soll sein:</strong></p>
<p>Ich will absoluten Neulingen, die noch nie etwas von CSS gehört haben, die Grundlagen und den sauberen Gebrauch von CSS näher bringen. Jeder Teil wird dabei etwas anspruchsvoller sein und es wird tiefer in die Materie vorgedrungen. Die Teile bauen dabei sukzessiv aufeinander auf. Profis werden sich allerdings kaum etwas Neues aus diesem Tutorial nehmen können.</p>
<p><span id="more-276"></span></p>
<p><strong>Voraussetzungen:</strong></p>
<ol>
<li>(sehr) gute (X)HTML-Kenntnisse (alle gängigen Tags, W3C-konform)</li>
<li>Nerven aus Stahl (Stichwort IE6-Optimierung)</li>
<li>Fähigkeit zu Lesen &#8211; auch die englische Sprache &#8211; und zu Denken</li>
<li>Hang zum Perfektionismus</li>
</ol>
<p>Du erfüllst alle Punkte? Dann können wir ja anfangen.. (wenn nicht, ist auch nicht so schlimm, man wächst schließlich mit jeder Herausforderung <img src='https://www.normansblog.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )</p>
<blockquote><p>CSS.. kann man das essen?</p></blockquote>
<p>Nein, essen kann man es nicht. CSS steht für <strong>C</strong>ascading <strong>S</strong>tyle <strong>S</strong>heets und ist ein vom <a href="http://www.w3.org">W3C</a> erschaffener und herausgebrachter Standard zur Darstellung von (X)HTML Tags.</p>
<blockquote><p>Okay.. und wie kann ich das nun benutzen?</p></blockquote>
<p>Das lustige ist, dass jede Seite bereits gestylt dargestellt wird, da der Browser vorgibt, wie welches Tag gerendert wird. Leider hat jeder Browser andere Default Styles und die Seite sieht dadurch von Browser zu Browser unterschiedlich aus. Außerdem will man ja etwas Besonderes kreieren oder umsetzen und das soll in jedem Browser gleich aussehen.</p>
<p>CSS kann auf vier unterschiedliche Art und Weisen auf eine HTML Datei angewendet werden:</p>
<ol>
<li>Browser Default</li>
<li>externes Stylesheet</li>
<li>internes Stylesheet</li>
<li>inline Style</li>
</ol>
<p>Die oberste Variante hat die geringste, die unterste die höhste Priorität. Sollte es vorkommen, dass ein HTML-Element von zwei oder mehr solcher Varianten beeinflusst wird, so &#8220;gewinnt&#8221; stehts die mit der höchsten Priorität.</p>
<h3>Varianten im Detail</h3>
<p>Da Browser Default nicht verändert werden kann, brauchen wir das auch nicht zu berücksichtigen.</p>
<p><strong>externes Stylesheet:</strong></p>
<p>Bei dieser Variante wird eine normale Text-Datei (mit Texteditor wie Notepad, Wordpad oder <a href="http://notepad-plus.sourceforge.net">Notepad++</a> öffnen) mit der Endung <code>.css</code> erstellt und in der <code>.html</code> Datei referenziert. Dabei wird folgender Code innerhalb des <code>head</code>-Tags geschrieben.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;url_zum_stylesheet/stylesheet.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">media</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;screen&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></pre></td></tr></table></div>

<p>Damit weiß der Browser nun, dass er sich unter &#8220;url_zum_stylesheet&#8221; die Datei <code>stylesheet.css</code> suchen muss und dass diese Datei ihm sagt, was er zu tun hat.</p>
<p><strong>internes Stylesheet:</strong></p>
<p>Intere Stylesheets werden innerhalb des <code>head</code>-Tags geschrieben. Man benutzt das <code>style</code>-Tag und schriebt dort den CSS Code hinein. Hierbei muss keine <code>.css</code> Datei angelegt werden.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">style</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span>&gt;</span>
	...
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">style</span>&gt;</span></pre></td></tr></table></div>

<p><strong>inline Style:</strong></p>
<p>Inline Styles werden direkt als Attribut eines HTML-Tags geschrieben.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;...&quot;</span>&gt;</span>
	Ich bin ein gestylter Absatz.
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span></pre></td></tr></table></div>

<blockquote><p>Alles klar und welche nehm ich jetzt, was ist am besten?</p></blockquote>
<p>Diese Frage ist einfach zu beantworten. Es ist <strong>immer</strong> zu empfehlen ein <strong>externes Stylesheet</strong> zu benutzen. Es hält die HTML Datei klein und beschleunigt somit das Herunterladen der Seite. Außerdem ist es übersichtlicher und sauberer.</p>
<p>Die Variante des internen Stylesheets bietet sich bei kleinen, sehr kompakten Projekten an, ein Newsletter ist wohl das beste Beispiel.</p>
<p>Inline Style ist nur in Notfällen zu benutzen! Am besten gleich wieder vergessen, dass es das gibt. (Ich weiß, die Versuchung ist groß <img src='https://www.normansblog.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  )</p>
<h3>Syntax</h3>
<blockquote><p>Okay dann nehme ich halt die externe Variante.. .css Datei ist erstellt und Eintrag im Header gemacht, was nun?</p></blockquote>
<p>Gratulation, jetzt kannst du anfangen deinen ersten richtigen CSS Code zu schreiben <img src='https://www.normansblog.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ! Anhand eines Beispiels soll gezeigt werden, wie man einen Paragraphen stylt. Der HTML Code lautet wie folgt:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;absatz&quot;</span>&gt;</span>
	Ich bin ein gestylter Absatz. Ich bin ein gestylter Absatz. Ich bin ein gestylter Absatz. Ich bin ein gestylter Absatz. Ich bin ein gestylter Absatz. Ich bin ein gestylter Absatz. Ich bin ein gestylter Absatz. Ich bin ein gestylter Absatz. Ich bin ein gestylter Absatz. Ich bin ein gestylter Absatz.
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span></pre></td></tr></table></div>

<p><strong>Beachte:</strong> der Absatz hat durch das Attribut <code>class</code> eine CSS-Klasse bekommen. Das ist ähnlich einem Namen, jeder Absatz mit dieser Klasse wird nun so dargestellt, wie wir es in der CSS Datei festlegen. Einfach folgenden Code in deine CSS Datei kopieren.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">p<span style="color: #6666ff;">.absatz</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#CCCCCC</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#000000</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> Georgia<span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">16px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#000000</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">justify</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Wenn wir jetzt die HTML-Seite in unserem Browser öffnen, sollte der Absatz nun so aussehen:</p>
<p style="background-color: #CCCCCC;border: 2px solid #000000;font-family: Georgia;font-size: 16px;color: #000000;padding: 20px;margin: 10px 0;text-align: justify;">
	Ich bin ein gestylter Absatz. Ich bin ein gestylter Absatz. Ich bin ein gestylter Absatz. Ich bin ein gestylter Absatz. Ich bin ein gestylter Absatz. Ich bin ein gestylter Absatz. Ich bin ein gestylter Absatz. Ich bin ein gestylter Absatz. Ich bin ein gestylter Absatz. Ich bin ein gestylter Absatz.
</p>
<blockquote><p>Tut er aber nicht <img src='https://www.normansblog.de/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p></blockquote>
<p>Sollte sich nichts geändert haben, überprüfe den Pfad zur CSS Datei im Header deiner HTML Datei (der Pfad kann auch relativ gesetzt werden).</p>
<p>Jetzt zur Erläuterung der einzelnen Zeilen des CSS Codes:</p>
<p><code>p.absatz</code> ist ein Sperator, der sorgt dafür, dass alle <code>p</code>-Tags mit der Klasse <code>absatz</code> vom nachfolgenden Code betroffen sind. Der eigentliche Code steht in geschweiften Klammern.</p>
<p><code>background-color: #CCCCCC;</code> gibt dem Hintergrund des Paragraphen eine Farbe; Farbwerte gibt man in der Regel <a href="http://de.wikipedia.org/wiki/Hexadezimalsystem">hexadezimalcodiert</a> an (<code>#000000</code> = schwarz, <code>#FFFFFF</code> = weiß)</p>
<p><code>border: 2px solid #000000;</code> gibt dem Paragraphen einen Rahmen, der 2 Pixel dick ist aus aus einer durchgezogenen Linie in der Farbe Schwarz besteht</p>
<p><code>font-family: Georgia;</code> legt die Schriftfamilie fest, hier Georgia</p>
<p><code>font-size: 16px;</code> legt die Schriftgröße fest, hier 16 Pixel</p>
<p><code>color: #000000;</code> legt die Schriftfarbe fest, hier Schwarz</p>
<p><code>padding: 20px;</code> zwischen Inhalt und Rahmen wird zusätzlicher Platz reserviert, sogenanntes &#8220;Padding&#8221;</p>
<p><code>margin: 10px 0;</code> gibt dem Inhalt einen Außenabstand nach oben und nach unten (10 Pixel), links und rechts bleibt der Abstand aber auf 0 Pixel</p>
<p><code>text-align: justify;</code> kontrolliert den Textfluss innerhalb des Absatzes, justify bedeutet Blocksatz</p>
<p>Nach jedem &#8220;Befehl&#8221;, den sogenannten Properties, folgt ein Semikolon. Die schließende Klammer nicht vergessen!</p>
<blockquote><p>Aha soweit so gut, was gibt es denn noch so?</p></blockquote>
<p>Eine Liste mit allen Properties findet man unter <a href="http://www.w3schools.com/cssref/default.asp">www.w3schools.com</a>, dort sind auch zu allen Properties Beispiele und wichtige Hinweise allerdings nur in Englisch.</p>
<p>Okay für heute soll es das gewesen sein. Probiert euch am besten an dem Absatz noch etwas.. wie wäre es mit einer anderen Schriftart oder einer anderen Hintergrundfarbe? Spielt einfach etwas mit den Werten und ihr werdet merken, wie schnell und einfach CSS zu erlernen ist.</p>
<p>In Teil 2 gehts mit noch mehr Syntax weiter und anhand eines kleinen Layouts werden wir das Positionieren von <code>div</code>s lernen. Folgende Teile stehen zum Weiterlesen bereit:</p>
<ol>
<li>Teil #1 (XHTML+CSS, Syntax)</li>
<li><a href="https://www.normansblog.de/css-beginner-tutorial-2/">Teil #2 (Syntax, Selektoren, Box-Model)</a></li>
<li><a href="https://www.normansblog.de/css-beginner-tutorial-3/">Teil #3 (Zweispaltiges Layout, Float)</a></li>
</ol>
<blockquote class="idea"><p>War dieses Tutorial hilfreich? Hast du Fehler gefunden oder etwas vermisst? Dann hinterlasse einfach einen Kommentar <img src='https://www.normansblog.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p></blockquote>
]]></content:encoded>
			<wfw:commentRss>https://www.normansblog.de/css-beginner-tutorial-1/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
