Breaking the mold with CSS

Slides:



Advertisements
Similar presentations
HTML and CSS. HTML Hyper Text Markup Language Tells browser how to display text and images.
Advertisements

J ENWARE Chapters 14 & 15 Learning Web Design, Fourth Edition by Jennifer Niederst Robbins Copyright © 2012.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Today CSS HTML A project.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Very quick intro HTML and CSS. Sample html A Web Title.
FORMATTING IN CONTEXT. FOLLOW UPS ANCHOR POINTS MUST BE UNIQUE  If you have more than one, how does it know where to go?  They can be repeated across.
Session 4: CSS Positioning Fall 2006 LIS Web Team.
SM5312 week 11: CSS Menus & Navigation Bars1 An Introduction to Cascading Style Sheets CSS Menus and Navigation Bars Nick Foxall.
Advance CSS (Menu and Layout) Miftahul Huda. CSS Navigation MENU It's truly remarkable what can be achieved through CSS, especially with navigation menus.
CIS 1310 – HTML & CSS 6 Layout. CIS 1310 – HTML & CSS Learning Outcomes  Describe & Apply the CSS Box Model  Configure Float with CSS  Designate Positioning.
Web Pages and Style Sheets Bert Wachsmuth. HTML versus XHTML XHTML is a stricter version of HTML: HTML + stricter rules = XHTML. XHTML Rule violations:
Class four: the box model and positioning. is an HTML tag which allows you to create an element out of inline text. It doesn’t mean anything! try it:
Tutorial 4: Creating page layout with css
Session 4: CSS Positioning Fall 2007 LIS Web Team.
CSS, cont. October 12, Unit 4. Creating a Sidebar We know how to create a sidebar –Use the float property div#sidebar{ float: left; } Item1 Item2 Item3.
Session 4: CSS Positioning Fall 2009 LIS Web Team.
INFSCI  Start with a skeleton outline: copy and paste:  Warning sometimes copy and paste of quote marks from PowerPoint doesn’t work correctly.
Cascading Style Sheet Basics Pepper. Looking at the HTML See the surrounding tags See head, body, paragraph, header See the ending tags See the list.
CSS Sprites. What are sprites? In the early days of video games, memory for graphics was very low. So to make things load quickly and make graphics look.
Basic Responsive Design Techniques. Let’s take a look at this basic layout. It has a header and two columns of text, in a box that is centered on the.
CSS – Presentation of Information. Types of Style Sheets External Embedded h1{color:red; font-family: Arial;} Inline Text is here.
Doman’s Sections Information in this presentation includes text and images from
Today’s objectives  Assignment 1  Padding, Margins, Borders  Fluid Layout page  Building accessible Table  Element size with padding and border 
 Word doc for you to download › Link at the beginning of class › 10 Questions › Answers to be added inline  Post to Sakai when completed › No resubmits.
End User Computing More on HTML and CSS Sujana Jyothi Department of Computer Science
 Remember that HTML is just text  Need to point to pictures  Use the img tag  alt: › screen reader › REQUIRED for this class and to validate.
Tutorial #6 – Creating Fixed Width Layouts. Tutorial #5 Review – Box Model Every html element is surround by a box Content, Padding, Border, Margin Can.
WRA HTML & CSS – BUILDING WEBPAGES. TODAY’S AGENDA Review: external stylesheets Review: transforming a list Intro: the object Intro: the.
CSS Positioning & Layout Creating layouts and controlling elements.
CONTROLLING Page layout
BEGINNER WEB DESIGN. INTRODUCTION Vocabulary Design Tools of the Trade HTML CSS.
 Add one element at a time  If it doesn’t do what you want, › Delete it › DON’T just keep piling on more items.
NAVIGATION USING HTML TO SET UP THE BASIC STRUCTURE OF A NAV BAR.
Cascading Style Sheets for layout
Cascading Style Sheets Layout
CS 0134 (term 2181) Jarrett Billingsley
Animation and Flexboxes
CSS Layouts: Positioning and Navbars
Google fonts CSS box model
CSS Layouts: Grouping Elements
More advanced HTML and CSS
CSS Box Model <span> & <div>
Float.
Advanced CSS BIS1523 – Lecture 20.
Display Property.
Cascading Style Sheets for layout
Box model.
Cascading Style Sheets (Layout)
Putting Things Where We Want Them
CS 0134 (term 2181) Jarrett Billingsley
Tables, inputs, and variables
CS 0134 (term 2181) Jarrett Billingsley
Creating a Baseline Grid
6 Layout.
Styles and the Box Model
Laying out a website using CSS and HTML
Fixed Positioning.
Controlling Layout with Style Sheets
CSS Box Model.
MORE Cascading Style Sheets (The Positioning Model)
Float.
Floating and Positioning
CSS and Class Tools.
Laying out Elements with CSS
Multipage Sites.
CSS Layout: Flexbox.
The div Element and CSS for layout
Understanding and Defining Web Page Layout
CS/COE 1520 Jarrett Billingsley
Presentation transcript:

Breaking the mold with CSS CS 0134 (term 2181) Jarrett Billingsley

Class announcements The first exam is in two weeks! The written part will be closed-book/notes The practical part will be open-book/notes Don't worry about turning in lab3 until I send out the lab2 grades. I kinda dropped the ball there.  9/25/2017 CS 0134 term 2181

Dividing things up 9/25/2017 CS 0134 term 2181

Sectioning things up main header navigation Thing 1 Thing 2 Thing 3 You know about <header> and <main>! But now your page has a few sections, and you have some links at the top to navigate to them. This is what that <nav> tag is for. You can put it in <header> or in <main>. It's just there to help organize things better. You can also make sections with <section>. This will make it easier to style some things. You could also use <article> on a blog! Last comes the <footer>. You don't have to put a footer but it's a nice place to stick your name or whatever. header navigation main footer Thing 1 Thing 2 Thing 3 9/25/2017 CS 0134 term 2181

Putting images in their place Let's say you want your image to be alongside the text, like in a magazine. The term for this is floating. The CSS for this might be: img { float: right; } When we tell something to float, it will stick to that side and other things will "flow" around it. You have to put the image before the text that you want to flow around it. Weird Dog #1 Blah blah blah! This is a bunch of words. This thing on the right is a living cotton ball. It upsets me. What is it? Why is it so small? Is it OK? Does it need help? This text is going to wrap around the sides of the image, and it'll look great. Now the text goes all the way to the right side. Nice! And the cool thing is, I didn't have to do anything in the HTML. It's all CSS. 9/25/2017 CS 0134 term 2181

Uh, that's not right. When you float something, the layout can start to get weird. What's missing in our HTML is a way to tell the browser to stop floating things! This is called clearing. Right before the thing you want to stop floating at, put: <div style="clear:both"></div> This is called a clearfix. Where would I want to put the clearfix in this example? Weird Dog #1 Blah blah blah! This is a bunch of words. This thing on the right is a living cotton ball. It upsets me. What is it? Why is it so small? Is it OK? Does it need help? Weird Dog #2 Maybe dogs were a mistake. 9/25/2017 CS 0134 term 2181

We all float down here, within reason You can float anything! Tables! Paragraphs! Entire sections! But don't use it for laying out pages (book pages starting at 204) This is an older technique and it's a giant pain Next week we'll learn a much easier way of doing this: flexboxes. 9/25/2017 CS 0134 term 2181

Making navigation bars 9/25/2017 CS 0134 term 2181

nav > ul > li > a { } Lists, schmists With CSS, you can make anything look like anything. To make this easier, we'll be using a new kind of CSS selector. nav > ul { } When we write this, it means "select the ul inside the nav." You can keep going as long as you want: nav > ul > li { } nav > ul > li > a { } 9/25/2017 CS 0134 term 2181

I'm too flexy for my lists The basic rules for this are as follows: nav > ul { display: flex; list-style: none; } nav > ul > li { flex-grow: 1; This says "make this list display its stuff left-to-right and turn off the bullets. This says "space the list items out evenly." 9/25/2017 CS 0134 term 2181

Where the heck is this extra space coming from? This is a great use for the inspector. Open the inspector, then click the button that looks like this: Then you can hover over the page and see what things are making the spacing! It's this stupid <ul>. 9/25/2017 CS 0134 term 2181

Another kind of display: block You can turn inline tags into block tags with this CSS property: display: block; Now you get the benefits of blocks (padding, margin, border)! Let's put it on the <a> of the navigation bar. This also makes it possible to click the whole box around the link, instead of just the text. 9/25/2017 CS 0134 term 2181

Ow ow those sharp corners Sometimes a rounding effect is nice. The border-radius property lets you do this. Set it to a length like 4px or 1em for a rounded rectangle! Try one or two percentages (like 50% 100%) for an oval! 9/25/2017 CS 0134 term 2181

Making things pop with shadows You can even put shadows behind things. text-shadow: 0.2em 0.2em 0.2em green; box-shadow: 0em 0em 1em red; This is how far left/right it is (negative numbers move left). This is how far up/down it is (negative numbers move up). This is how blurry it is. 0 means super sharp! 9/25/2017 CS 0134 term 2181

Lab: improving your page from last time 9/25/2017 CS 0134 term 2181

Lab: better CSS! 9/25/2017 CS 0134 term 2181