330 likes | 473 Views
PART II 10.04.2007 dmfd. Comments. Remember: make a homepage using CSS Next Tuesday: guest lecture on Web 2.0. Goals of the lecture. See some other panels in DW Understand an example of CSS layout. Index. CSS panel Example of layout Results panel. Insert bar. The workspace.
E N D
PART II 10.04.2007 dmfd
Comments • Remember: make a homepage using CSS • Next Tuesday: guest lecture on Web 2.0
Goals of the lecture • See some other panels in DW • Understand an example of CSS layout
Index • CSS panel • Example of layout • Results panel
Insert bar The workspace Document bar CSS panel Code window Coding toolbar WYSIWYG window Tag selector Files panel Property inspector Results panel
Index • CSS panel • Example of layout • Results panel
Example of layout with CSS container header content maincol subcol
CSS layout: structuring divs <body> <div id="container"> <div id="header"> <div id="title"> ... </div> <div id="nav"> ... </div> </div> <div id="content"> <div id="maincol"> ... </div> <div id="subcol"> ... </div> </div> </div> </body>
CSS layout: container #container { position: absolute; width: 750px; left: 50%; margin-left: -375px; } Center hack
CSS layout: header header title nav
CSS layout: header II <div id="header"> <div id="title"> <h1>The rhythm of the war drums</h1> </div> <div id="nav"> <ul> <li><a href="index.html">Home</a></li> <li><a href="cv/cv.html">CV</a></li> <li><a href="links/links.html">Links</a></li> </ul> </div> </div> #header { position: absolute; top:0px; width:750px; }
CSS layout: header III #title { position: absolute; top: 0px; width: 100%; margin: 0px; height: 100px; } #nav { position: absolute; top: 100px; left: 0px; width: 100%; height: 20px; } #nav ul { list-style-type: none; padding: 0px; margin: 0px; border: solid #ccc; border-width:0 1px; } Title (logo) Navigation bar using a list #nav li { display: inline; }
CSS layout: content content maincol subcol
CSS layout: content II <div id="content"> <div id="maincol"> <h3>Counting bodies like sheep</h3> <p><img src="images/logo.jpg" alt="logoAPC" class="logo" /> Don't fret precious, I'm here<br /> Step away from the window<br /> And go back to sleep<br /> ... </div> <div id="subcol"> <ul> <li>1</li> <li>2</li> <li>3</li> </ul> </div> </div>
CSS layout: content III #maincol { position: absolute; left: 0px; width: 595px; background-color: #c8956f; padding: 0 0 0 5px; } #content { position: absolute; top:120px; width:750px; } #subcol { position: absolute; right: 0px; width:150px; background-color:#a77b5b; }
CSS layout: structuring divs <body> <div id="container"> <div id="header"> <div id="title"> ... </div> <div id="nav"> ... </div> </div> <div id="content"> <div id="maincol"> ... </div> <div id="subcol"> ... </div> </div> </div> </body>
CSS layout: container #container { position: relative; top: 0px; width: 80%; margin: 0 auto; }
CSS layout: header header title nav
CSS layout: header II <div id="header"> <div id="title"> <h1>The rhythm of the war drums</h1> </div> <div id="nav"> <ul> <li><a href="index.html">Home</a></li> <li><a href="cv/cv.html">CV</a></li> <li><a href="links/links.html">Links</a></li> </ul> </div> </div> #header { position: relative; width:100%; }
CSS layout: header III #title { float: left; width: 100%; padding: 0; margin: 0px; } #nav { position: relative; width: 100%; } #nav ul { list-style-type: none; padding: 0px; margin: 0px; border: solid #ccc; border-width:0 1px; } Title (logo) Navigation bar using a list #nav li { display: inline; }
CSS layout: content content maincol subcol
CSS layout: content II <div id="content"> <div id="maincol"> <h3>Counting bodies like sheep</h3> <p><img src="images/logo.jpg" alt="logoAPC" class="logo" /> Don't fret precious, I'm here<br /> Step away from the window<br /> And go back to sleep<br /> ... </div> <div id="subcol"> <ul> <li>1</li> <li>2</li> <li>3</li> </ul> </div> </div>
CSS layout: content III #maincol { float: left; width: 80%; background-color: #c8956f; padding: 0 0 0 5px; } #content { position: relative; width: 100%; } #subcol { float: right; width: 18%; background-color:#a77b5b; }
Index • CSS panel • Example of layout • Results panel
Property inspector • Changes depending on the selected object
Validator • Results panel, Validation tab
Browser check • Results panel, Target Browser Check tab