190 likes | 203 Views
Learn the basics of Cascading Style Sheets (CSS) for web design, troubleshoot file extension issues, and improve your page layout with this helpful guide.
E N D
The .htm/.html Mystery • When saving the template files in Internet Explorer, they will be named .htm by default. To be consistent with how the code was written in the template, you must rename the file extension: .html or else the links in your navigation bar will not work. • Our current recommendation is to save the files from Mozilla Firefox in order to avoid this issue. Firefox saves the files as .html by default.
Troubleshooting If have problems with naming or re-naming the file extension (ex. .txt, .doc, .htm, .html, etc.): Open up Control Panel in your PC. Within Control Panel search for “Folder Options”. Open it and click on the View tab and un-check the box for “Hide extensions for known file types”.
CSS Basics LIS Webteam October 15, 2010
Why CSS? • What’s wrong with HTML? • Structure vs Style • Early web design used hacks to style webpages with HTML – like tables to set aside parts of a page • Cascading Style Sheets designed to solve a number of problems
Why CSS • Separate style from structure, this lets programs and devices read HTML for what it is • Cascading feature allows designers multiple levels of control • Global style changes that took tedious work to do in HTML now takes seconds in CSS
What can you do with CSS • Colors, backgrounds • Fonts • Spacing • Page positioning
CSS Basic structure selector { property : value; } Examples h1 { color : red; } p { background-color : #00FFFF; } a { font-size : 3em; color : red; }
Cascades • 3 levels of CSS • Checked in this order, each overrides the previous • External style sheet – applies to many pages • Internal style sheet – applies to all of 1 page • Inline style – applies to single HTML element
3 levels of CSS External Style Sheet Ex.: eportfolio.css
3 levels of CSS Internal Style Sheet Placed near the beginning of an html document between the <head></head> tags, and enclosed by the <style type=“text/css”> </style> tags.
3 levels of CSS Internal Style Sheet Example <html> <head> <style type="text/css"> p {color: white; } body {background-color: blue; } </style> </head> <body> <p>White text on a blue background!</p> </body> </html> The “Internal Style Sheet”
3 levels of CSS Inline Style Overrides the rules in the external and internal style sheets. Goes right in the HTML tag as an attribute. Ex.: <p style = “background = red;”>blah blah blah</p>
The CSS Box Model Margin Border Padding Content
Page Layout Block 1 Block 3 Block 2 Block 4
Time to Practice • Work through the handout exercises • Play around with CSS • RGB Calculator!
Where to go for more • LIS Webteam • w3schools.com