Git Product home page Git Product logo

skills-fswd-2.0-css-validation-lab's Introduction

Writing Valid CSS Lab

In this lab we’re going to focus on writing the CSS rule-sets.

Objectives

  • Practice writing CSS rule-sets
  • Practice writing different CSS selectors
  • Practice writing a variety of CSS properties

Instructions

Work through the problems below one at a time, writing your solutions in index.css. There is no need to write any HTML, but feel free to use index.html while testing out the effects of different CSS properties. Run learn to verify you've written a correct solution for each problem.

1) Add a Rule-Set for a main Class

  • Add font-size and font-family properties to the rule-set

2) Add a Rule-Set for a centerText Class

  • Add text-align, height, and line-height properties to the rule-set

Side Note: The setting height and line-height to the same value will vertically align text. Setting text-center to center will horizontally align text

3) Add a Rule-Set for a 'title' Id

  • Add font, text-align, and text-decoration properties to the rule-set

4) Add a Rule-Set for All img Elements

  • Add display, margin-left, margin-right and width properties to the rule-set

5) Add a Rule-Set for All img Elements that are Descendants of div Elements

  • Add display, margin-left, margin-right and width properties to the rule-set

Note: Order and specificity of rule-sets matters. If this

6) Add a Rule-Set for All a Elements

  • Add text-decoration and color properties to the rule-set

7) Add a Rule-Set for All a Elements on Hover

  • Add text-shadow and font-weight properties to the rule-set

8) Add a Rule-Set for All span and p Elements

  • Add font-style and left properties to the rule-set

9) Add a Rule-Set for All children of all section Elements

  • Add visibility and opacity properties to the rule-set

Conclusion

CSS provides detailed control over how webpage content is displayed. We can apply rules that have a broad effect and later rules that fine tune specific elements. CSS syntax, however, can be strict, so it is good to practice writing out a variety of rule-sets. You can always use the W3 CSS validator to check if your CSS is valid.

References

-CSS Selectors -CSS Specificity

skills-fswd-2.0-css-validation-lab's People

Contributors

maxwellbenton avatar sgharms avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.