SlideShare ist ein Scribd-Unternehmen logo
1 von 15
Intro to HTML/CSS
                  Class 2 Handout: CSS Exercises

1. Link CSS

  Use the Aptana handout from the first class to create a CSS file for
  your project called style.css. Link the CSS file to your html by adding
  the following code to the head of your HTML document:

  <link rel="stylesheet" href="style.css"/>




2. body & font-family

  The font-family property specifies the font for an element. It can hold
  several font names as a “fallback” in case the user’s browser does
  not support the first font, in which case it tries the next font in the list.

  There are two types of font family names:

      • family-name
           o The name of a font-family, like “times”, “courier” or “ariel”,
               etc
      • generic-family
           o The name of a generic family, such as “serif”, “sans-serif”,
               “cursive” or “monospace”
           o
  Add a font-family to the body of our HTML page by adding the
  following to the style.css file:



                                                                                  1
body{
        font-family: Helvetica;
}




In our Aptana preview pane, our page is now in Helvetica:




That is, if you have Helvetica installed! (Mac users will probably see
the change, and Windows users that don’t have Helvetica installed


                                                                         2
will probably not.) To change our font for all users, we need to add
     some fallback fonts:

     body{
             font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
     }




     Now even if you do not have Helvetica installed, you should at least
     see a sans-serif font.

3.   background-color

     We will also add a background-color to our body selector:

     body{
             font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
             background-color: #88A33E;
     }




     CSS supports 17 standard plus 130 additional color names, such as
     aqua, black, white, gray, lime, etc. You can find those colors at
     http://www.w3schools.com/cssref/css_colornames.asp.

     To specify additional colors, we are using hex values, such as
     #88A33E in the example above, which is a green color. There are
     other ways to specify colors, which we will learn in the fourth class.

   To come up with interesting color schemes, Adobe has a free product
   at http://kuler.adobe.com that allows you to create different color
   schemes based on a starting color.
4. background-image

     Go to the following image on your browser:
     http://citrusmoon.typepad.com/photos/tiles/wikid2.gif


                                                                              3
Right click on the image and save as “background.gif”. In Aptana, in
your FirstProject project folder, right click on the project folder and
click New->Folder to make a new folder. Call this folder images.

In your downloads folder, where you saved the background tile, drag
the background.gif file into the “images” folder in Aptana. When
Aptana prompts you, copy the file.

This is what our directory should look like now:




In our style.css, add the following line to our body selector:

background-image: url('images/background.gif');




Our Aptana preview pane should look like this:




                                                                          4
By default, a background image is placed at the top left corner of an
element, and repeated both vertically and horizontally.

  5. background-attachment, background-position, background-
     repeat

     To alter the default behavior, we can use the following CSS
     properties:

     background-attachment – sets whether a background image is fixed
     or scrolls with the rest of the page

     background-position – sets the starting position of a background
     image

     background-repeat – sets if/how a background image will be repeated


     add the following to the body selector of our style.css file:

     background-repeat:no-repeat;
     background-attachment:fixed;
     background-position:center;




                                                                             5
Now our background tile is centered and does not repeat horizontally
  or vertically:




  But that looks awful, so we will remove those three lines. We just did
  that so we would see how these three CSS properties work.

  Our body selector should look like this again:

  body{
           font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
           background-color: #88A33E;
           background-image: url('images/background.gif');
  }


6. color

  The color property specifies the color of text. Black is a little hard to
  read on our new background, so we will add this color to our body
  selector:

  color: #F7F2B2;




                                                                              6
Now our page looks like this:




Let’s add some different colors for our h1 and h2 tags:

h1{
      color: #541E32;
}
h2{
      color: #8E3557;
}




                                                          7
7. text-indent

  The text-indent property specifies the indentation of the first line ina
  text-bock. We will add a text indent to our <p> tags:

  p{
        text-indent: 50px;
  }




                                                                             8
Now we can go into our index.html and remove the indent we created
with the &nbsp;




                                                                 9
Now our indents are matching:




8. text-transform

  The text-transform property controls the capitalization of text. For
  example, you an set the text-transform property value to uppercase,
  capitalize, or lowercase. Let’s say we want our h1 tags in all
  uppercase:

  h1{
        color: #541E32;
        text-transform: uppercase;
  }




                                                                         10
Now our h1 heading is all caps, even though our source code shows
  otherwise:




9. Other font properties

  We can use other font properties such as font-size, font-weight, and
  font-style to style our text.

  font-size – sets the size of a font. Several units can be specified for
  font-size. You will commonly see pixels (px), but could also see em
  (sets the font in relation to the browser’s default font size), ex (refers
  to the x-height of the font, absolute sizes such as xx-small, x-small,
  small, medium and large, or relative sizes such as smaller or larger.
  W3C recommends using em’s for accessibility.

  font-weight – sets how thick or thin certain characters appear.
  Property values include normal, bold, bolder and lighter.

  font-style: specifies a font-style for the text such as italic or oblique

  Let’s change the style of the text in our p tags:

  p{
        text-indent: 50px;
        font-size: 1.5em;
        font-weight:lighter;
        font-style:oblique;
  }




                                                                              11
10.     div

  Let’s add some div containers around our existing html code. We wll
  give our first div a class name of “info”.

  <div class="info">
        <h1>Learning New Skills</h1>
        <h2>With GDI Cincinnati!</h2>

        <p>Want to learn how to build your own website?<br> Already
  have your own Tumblr/Wordpress/etc site, but want to have more
  control over it?<br> Interested in learning to program but want to start
  small? This class is for you!</p>

        <p>We will guide you through the basics of HTML and CSS,
  give you some readily-applicable skills, and answer any questions
  you may have along the way.</p>
  </div>


                                                                        12
If you look in the Aptana preview pane, our page shouldn’t look any
different.

Let’s add some declarations for our new class, and a comment:

/*This is the style for our "info" class */
.info{
       width: 1024px;
       height: 768px;
       text-align: center;
}




If you scroll down, you will notice a lot of blank space before we reach
the image on our page. This is because of the div height we set in our
CSS.

Let’s add some classes to our lists:


             <ol class="roman">
                   <li>Do my laundry</li>
                   <li>Pay my bills</li>
                   <li>Go to the bank</li>
             </ol>

                                                                      13
<h3>More Things to Do</h3>
              <ul class="square">
                    <li>Do my laundry</li>
                    <li>Pay my bills</li>
                    <li>Go to the bank</li>
              </ul>

  And we will add some class selectors to our CSS:

  ul.square {
        list-style-type:square;
  }

  ol.roman {
        list-style-type: upper-roman;
  }

  Our Aptana preview should show our lists as styled:




11.     Styling tables with CSS

You can use CSS properties such as border, background-color and
color to style your tables.

Add the following selectors and declarations to your style.css:


                                                                  14
table, td, th{
   border: 1px solid #88A33E;
   background-color: #C2BD86;
   color: #88A33E;
}

th{
      background-color: #88A33E;
      color: #C2BD86;
}

Your table should look like this:




                                    15

Weitere ähnliche Inhalte

Was ist angesagt?

ID01 Week 3
ID01 Week 3ID01 Week 3
ID01 Week 3mkontopo
 
Learn CSS From Scratch
Learn CSS From ScratchLearn CSS From Scratch
Learn CSS From Scratchecobold
 
CSS Less framework overview, Pros and Cons
CSS Less framework overview, Pros and ConsCSS Less framework overview, Pros and Cons
CSS Less framework overview, Pros and ConsSanjoy Kr. Paul
 
Custom WordPress theme development
Custom WordPress theme developmentCustom WordPress theme development
Custom WordPress theme developmentTammy Hart
 
Accelerated Stylesheets
Accelerated StylesheetsAccelerated Stylesheets
Accelerated StylesheetsWynn Netherland
 
WordPress Theme Development for Designers
WordPress Theme Development for DesignersWordPress Theme Development for Designers
WordPress Theme Development for Designerselliotjaystocks
 
ID01 / W01
ID01 / W01ID01 / W01
ID01 / W01mkontopo
 
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...LinnAlexandra
 
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 NepalWordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 NepalChandra Prakash Thapa
 
Big Design Conference: CSS3
Big Design Conference: CSS3 Big Design Conference: CSS3
Big Design Conference: CSS3 Wynn Netherland
 
Getting Started with Sass & Compass
Getting Started with Sass & CompassGetting Started with Sass & Compass
Getting Started with Sass & CompassRob Davarnia
 
GDI Seattle Intermediate HTML and CSS Class 1
GDI Seattle Intermediate HTML and CSS Class 1GDI Seattle Intermediate HTML and CSS Class 1
GDI Seattle Intermediate HTML and CSS Class 1Heather Rock
 
Haml And Sass In 15 Minutes
Haml And Sass In 15 MinutesHaml And Sass In 15 Minutes
Haml And Sass In 15 MinutesPatrick Crowley
 
WordPress Theme Development: Part 2
WordPress Theme Development: Part 2WordPress Theme Development: Part 2
WordPress Theme Development: Part 2Josh Lee
 
CSS Layout Tutorial
CSS Layout TutorialCSS Layout Tutorial
CSS Layout Tutorialhstryk
 
Accelerated Native Mobile Development with the Ti gem
Accelerated Native Mobile Development with the Ti gemAccelerated Native Mobile Development with the Ti gem
Accelerated Native Mobile Development with the Ti gemWynn Netherland
 
Sass presentation
Sass presentationSass presentation
Sass presentationDavin Abraham
 
Basic HTML & CSS
Basic HTML & CSSBasic HTML & CSS
Basic HTML & CSSJohn Nelson
 

Was ist angesagt? (20)

ID01 Week 3
ID01 Week 3ID01 Week 3
ID01 Week 3
 
Learn CSS From Scratch
Learn CSS From ScratchLearn CSS From Scratch
Learn CSS From Scratch
 
CSS Less framework overview, Pros and Cons
CSS Less framework overview, Pros and ConsCSS Less framework overview, Pros and Cons
CSS Less framework overview, Pros and Cons
 
Custom WordPress theme development
Custom WordPress theme developmentCustom WordPress theme development
Custom WordPress theme development
 
Accelerated Stylesheets
Accelerated StylesheetsAccelerated Stylesheets
Accelerated Stylesheets
 
WordPress Theme Development for Designers
WordPress Theme Development for DesignersWordPress Theme Development for Designers
WordPress Theme Development for Designers
 
ID01 / W01
ID01 / W01ID01 / W01
ID01 / W01
 
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
 
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 NepalWordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
 
Big Design Conference: CSS3
Big Design Conference: CSS3 Big Design Conference: CSS3
Big Design Conference: CSS3
 
Getting Started with Sass & Compass
Getting Started with Sass & CompassGetting Started with Sass & Compass
Getting Started with Sass & Compass
 
GDI Seattle Intermediate HTML and CSS Class 1
GDI Seattle Intermediate HTML and CSS Class 1GDI Seattle Intermediate HTML and CSS Class 1
GDI Seattle Intermediate HTML and CSS Class 1
 
HTML 101
HTML 101HTML 101
HTML 101
 
Haml And Sass In 15 Minutes
Haml And Sass In 15 MinutesHaml And Sass In 15 Minutes
Haml And Sass In 15 Minutes
 
WordPress Theme Development: Part 2
WordPress Theme Development: Part 2WordPress Theme Development: Part 2
WordPress Theme Development: Part 2
 
Creating forms
Creating formsCreating forms
Creating forms
 
CSS Layout Tutorial
CSS Layout TutorialCSS Layout Tutorial
CSS Layout Tutorial
 
Accelerated Native Mobile Development with the Ti gem
Accelerated Native Mobile Development with the Ti gemAccelerated Native Mobile Development with the Ti gem
Accelerated Native Mobile Development with the Ti gem
 
Sass presentation
Sass presentationSass presentation
Sass presentation
 
Basic HTML & CSS
Basic HTML & CSSBasic HTML & CSS
Basic HTML & CSS
 

Ă„hnlich wie Class 2 handout css exercises (2)

Web Typography
Web TypographyWeb Typography
Web TypographyShawn Calvert
 
Sacramento web design
Sacramento web designSacramento web design
Sacramento web designlambertvilleg_5
 
Customizing WordPress Themes
Customizing WordPress ThemesCustomizing WordPress Themes
Customizing WordPress ThemesLaura Hartwig
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Erin M. Kidwell
 
Html n css tutorial
Html n css tutorialHtml n css tutorial
Html n css tutorialzubeditufail
 
Introduction to css
Introduction to cssIntroduction to css
Introduction to cssnikhilsh66131
 
Css introduction
Css  introductionCss  introduction
Css introductionvishnu murthy
 
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.pptwaxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.pptIsmaciil2
 
Basic html training national
Basic html training nationalBasic html training national
Basic html training nationalNeedanuts
 
HTML Lab ProjectTo create a simple web page you will need .docx
HTML Lab ProjectTo create a simple web page you will need .docxHTML Lab ProjectTo create a simple web page you will need .docx
HTML Lab ProjectTo create a simple web page you will need .docxadampcarr67227
 
Spectrum 2015 going online with style - an intro to css
Spectrum 2015   going online with style - an intro to cssSpectrum 2015   going online with style - an intro to css
Spectrum 2015 going online with style - an intro to cssNeil Perlin
 

Ă„hnlich wie Class 2 handout css exercises (2) (20)

CSS
CSSCSS
CSS
 
Web Typography
Web TypographyWeb Typography
Web Typography
 
Sacramento web design
Sacramento web designSacramento web design
Sacramento web design
 
Customizing WordPress Themes
Customizing WordPress ThemesCustomizing WordPress Themes
Customizing WordPress Themes
 
CSS
CSSCSS
CSS
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
 
INTRODUCTIONS OF CSS
INTRODUCTIONS OF CSSINTRODUCTIONS OF CSS
INTRODUCTIONS OF CSS
 
html-css
html-csshtml-css
html-css
 
CSS ppt
CSS pptCSS ppt
CSS ppt
 
Html n css tutorial
Html n css tutorialHtml n css tutorial
Html n css tutorial
 
Introduction to css
Introduction to cssIntroduction to css
Introduction to css
 
Css introduction
Css  introductionCss  introduction
Css introduction
 
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.pptwaxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
 
css1.ppt
css1.pptcss1.ppt
css1.ppt
 
Basic html training national
Basic html training nationalBasic html training national
Basic html training national
 
Css
CssCss
Css
 
HTML Lab ProjectTo create a simple web page you will need .docx
HTML Lab ProjectTo create a simple web page you will need .docxHTML Lab ProjectTo create a simple web page you will need .docx
HTML Lab ProjectTo create a simple web page you will need .docx
 
Thuray css3
Thuray css3Thuray css3
Thuray css3
 
Css notes
Css notesCss notes
Css notes
 
Spectrum 2015 going online with style - an intro to css
Spectrum 2015   going online with style - an intro to cssSpectrum 2015   going online with style - an intro to css
Spectrum 2015 going online with style - an intro to css
 

Mehr von Erin M. Kidwell

Class 4 handout w css3 using j fiddle
Class 4 handout w css3 using j fiddleClass 4 handout w css3 using j fiddle
Class 4 handout w css3 using j fiddleErin M. Kidwell
 
Class 4 handout two column layout w mobile web design
Class 4 handout two column layout w mobile web designClass 4 handout two column layout w mobile web design
Class 4 handout two column layout w mobile web designErin M. Kidwell
 
Class 3 create an absolute layout with css abs position (aptana)
Class 3  create an absolute layout with css abs position (aptana)Class 3  create an absolute layout with css abs position (aptana)
Class 3 create an absolute layout with css abs position (aptana)Erin M. Kidwell
 
Class 3 Intro to HTML/ CSS Gdi cincinnati create a table layout with html (...
Class 3 Intro to HTML/ CSS Gdi cincinnati   create a table layout with html (...Class 3 Intro to HTML/ CSS Gdi cincinnati   create a table layout with html (...
Class 3 Intro to HTML/ CSS Gdi cincinnati create a table layout with html (...Erin M. Kidwell
 
Class 2 handout (1) adding a css stylesheet
Class 2 handout (1) adding a css stylesheetClass 2 handout (1) adding a css stylesheet
Class 2 handout (1) adding a css stylesheetErin M. Kidwell
 
Class 1 handout (2) html exercises
Class 1 handout (2) html exercisesClass 1 handout (2) html exercises
Class 1 handout (2) html exercisesErin M. Kidwell
 
Class 1 handout (1) aptana create a new presentation and stylesheet
Class 1 handout (1) aptana  create a new presentation and stylesheetClass 1 handout (1) aptana  create a new presentation and stylesheet
Class 1 handout (1) aptana create a new presentation and stylesheetErin M. Kidwell
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2Erin M. Kidwell
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 1
Girl Develop It Cincinnati: Intro to HTML/CSS Class 1Girl Develop It Cincinnati: Intro to HTML/CSS Class 1
Girl Develop It Cincinnati: Intro to HTML/CSS Class 1Erin M. Kidwell
 

Mehr von Erin M. Kidwell (9)

Class 4 handout w css3 using j fiddle
Class 4 handout w css3 using j fiddleClass 4 handout w css3 using j fiddle
Class 4 handout w css3 using j fiddle
 
Class 4 handout two column layout w mobile web design
Class 4 handout two column layout w mobile web designClass 4 handout two column layout w mobile web design
Class 4 handout two column layout w mobile web design
 
Class 3 create an absolute layout with css abs position (aptana)
Class 3  create an absolute layout with css abs position (aptana)Class 3  create an absolute layout with css abs position (aptana)
Class 3 create an absolute layout with css abs position (aptana)
 
Class 3 Intro to HTML/ CSS Gdi cincinnati create a table layout with html (...
Class 3 Intro to HTML/ CSS Gdi cincinnati   create a table layout with html (...Class 3 Intro to HTML/ CSS Gdi cincinnati   create a table layout with html (...
Class 3 Intro to HTML/ CSS Gdi cincinnati create a table layout with html (...
 
Class 2 handout (1) adding a css stylesheet
Class 2 handout (1) adding a css stylesheetClass 2 handout (1) adding a css stylesheet
Class 2 handout (1) adding a css stylesheet
 
Class 1 handout (2) html exercises
Class 1 handout (2) html exercisesClass 1 handout (2) html exercises
Class 1 handout (2) html exercises
 
Class 1 handout (1) aptana create a new presentation and stylesheet
Class 1 handout (1) aptana  create a new presentation and stylesheetClass 1 handout (1) aptana  create a new presentation and stylesheet
Class 1 handout (1) aptana create a new presentation and stylesheet
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 1
Girl Develop It Cincinnati: Intro to HTML/CSS Class 1Girl Develop It Cincinnati: Intro to HTML/CSS Class 1
Girl Develop It Cincinnati: Intro to HTML/CSS Class 1
 

KĂĽrzlich hochgeladen

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
WhatsApp 9892124323 âś“Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 âś“Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 âś“Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 âś“Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 

KĂĽrzlich hochgeladen (20)

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
WhatsApp 9892124323 âś“Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 âś“Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 âś“Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 âś“Call Girls In Kalyan ( Mumbai ) secure service
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 

Class 2 handout css exercises (2)

  • 1. Intro to HTML/CSS Class 2 Handout: CSS Exercises 1. Link CSS Use the Aptana handout from the first class to create a CSS file for your project called style.css. Link the CSS file to your html by adding the following code to the head of your HTML document: <link rel="stylesheet" href="style.css"/> 2. body & font-family The font-family property specifies the font for an element. It can hold several font names as a “fallback” in case the user’s browser does not support the first font, in which case it tries the next font in the list. There are two types of font family names: • family-name o The name of a font-family, like “times”, “courier” or “ariel”, etc • generic-family o The name of a generic family, such as “serif”, “sans-serif”, “cursive” or “monospace” o Add a font-family to the body of our HTML page by adding the following to the style.css file: 1
  • 2. body{ font-family: Helvetica; } In our Aptana preview pane, our page is now in Helvetica: That is, if you have Helvetica installed! (Mac users will probably see the change, and Windows users that don’t have Helvetica installed 2
  • 3. will probably not.) To change our font for all users, we need to add some fallback fonts: body{ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; } Now even if you do not have Helvetica installed, you should at least see a sans-serif font. 3. background-color We will also add a background-color to our body selector: body{ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; background-color: #88A33E; } CSS supports 17 standard plus 130 additional color names, such as aqua, black, white, gray, lime, etc. You can find those colors at http://www.w3schools.com/cssref/css_colornames.asp. To specify additional colors, we are using hex values, such as #88A33E in the example above, which is a green color. There are other ways to specify colors, which we will learn in the fourth class. To come up with interesting color schemes, Adobe has a free product at http://kuler.adobe.com that allows you to create different color schemes based on a starting color. 4. background-image Go to the following image on your browser: http://citrusmoon.typepad.com/photos/tiles/wikid2.gif 3
  • 4. Right click on the image and save as “background.gif”. In Aptana, in your FirstProject project folder, right click on the project folder and click New->Folder to make a new folder. Call this folder images. In your downloads folder, where you saved the background tile, drag the background.gif file into the “images” folder in Aptana. When Aptana prompts you, copy the file. This is what our directory should look like now: In our style.css, add the following line to our body selector: background-image: url('images/background.gif'); Our Aptana preview pane should look like this: 4
  • 5. By default, a background image is placed at the top left corner of an element, and repeated both vertically and horizontally. 5. background-attachment, background-position, background- repeat To alter the default behavior, we can use the following CSS properties: background-attachment – sets whether a background image is fixed or scrolls with the rest of the page background-position – sets the starting position of a background image background-repeat – sets if/how a background image will be repeated add the following to the body selector of our style.css file: background-repeat:no-repeat; background-attachment:fixed; background-position:center; 5
  • 6. Now our background tile is centered and does not repeat horizontally or vertically: But that looks awful, so we will remove those three lines. We just did that so we would see how these three CSS properties work. Our body selector should look like this again: body{ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; background-color: #88A33E; background-image: url('images/background.gif'); } 6. color The color property specifies the color of text. Black is a little hard to read on our new background, so we will add this color to our body selector: color: #F7F2B2; 6
  • 7. Now our page looks like this: Let’s add some different colors for our h1 and h2 tags: h1{ color: #541E32; } h2{ color: #8E3557; } 7
  • 8. 7. text-indent The text-indent property specifies the indentation of the first line ina text-bock. We will add a text indent to our <p> tags: p{ text-indent: 50px; } 8
  • 9. Now we can go into our index.html and remove the indent we created with the &nbsp; 9
  • 10. Now our indents are matching: 8. text-transform The text-transform property controls the capitalization of text. For example, you an set the text-transform property value to uppercase, capitalize, or lowercase. Let’s say we want our h1 tags in all uppercase: h1{ color: #541E32; text-transform: uppercase; } 10
  • 11. Now our h1 heading is all caps, even though our source code shows otherwise: 9. Other font properties We can use other font properties such as font-size, font-weight, and font-style to style our text. font-size – sets the size of a font. Several units can be specified for font-size. You will commonly see pixels (px), but could also see em (sets the font in relation to the browser’s default font size), ex (refers to the x-height of the font, absolute sizes such as xx-small, x-small, small, medium and large, or relative sizes such as smaller or larger. W3C recommends using em’s for accessibility. font-weight – sets how thick or thin certain characters appear. Property values include normal, bold, bolder and lighter. font-style: specifies a font-style for the text such as italic or oblique Let’s change the style of the text in our p tags: p{ text-indent: 50px; font-size: 1.5em; font-weight:lighter; font-style:oblique; } 11
  • 12. 10. div Let’s add some div containers around our existing html code. We wll give our first div a class name of “info”. <div class="info"> <h1>Learning New Skills</h1> <h2>With GDI Cincinnati!</h2> <p>Want to learn how to build your own website?<br> Already have your own Tumblr/Wordpress/etc site, but want to have more control over it?<br> Interested in learning to program but want to start small? This class is for you!</p> <p>We will guide you through the basics of HTML and CSS, give you some readily-applicable skills, and answer any questions you may have along the way.</p> </div> 12
  • 13. If you look in the Aptana preview pane, our page shouldn’t look any different. Let’s add some declarations for our new class, and a comment: /*This is the style for our "info" class */ .info{ width: 1024px; height: 768px; text-align: center; } If you scroll down, you will notice a lot of blank space before we reach the image on our page. This is because of the div height we set in our CSS. Let’s add some classes to our lists: <ol class="roman"> <li>Do my laundry</li> <li>Pay my bills</li> <li>Go to the bank</li> </ol> 13
  • 14. <h3>More Things to Do</h3> <ul class="square"> <li>Do my laundry</li> <li>Pay my bills</li> <li>Go to the bank</li> </ul> And we will add some class selectors to our CSS: ul.square { list-style-type:square; } ol.roman { list-style-type: upper-roman; } Our Aptana preview should show our lists as styled: 11. Styling tables with CSS You can use CSS properties such as border, background-color and color to style your tables. Add the following selectors and declarations to your style.css: 14
  • 15. table, td, th{ border: 1px solid #88A33E; background-color: #C2BD86; color: #88A33E; } th{ background-color: #88A33E; color: #C2BD86; } Your table should look like this: 15