- Link an external stylesheet to an html document
- Position elements using CSS
- Modify element style (size, color, etc) using CSS
- Compare and use classes and ids to manipulate elements
In this challenge, you will be adding CSS to your clone of Berkshire Hathaway's website.
Go through Releases 0 and 1 prior to pairing. Then get together with your pair for releases 2, 3, and 4.
This challenge will also be completed in your phase-0-unit-1 repository.
Go through the following resources to learn the basics of CSS.
- codecademy: Intro to CSS sections:
- CSS An Overview
- CSS Selectors
- CSS Positioning
Select one person's HTML version of the Berkshire Site HTML to modify with CSS. Then, using your command line, make a copy of that file in this css directory.
There are multiple ways to add CSS to HTML, but we generally prefer keeping formatting in a separate file, called a stylesheet. In this directory, you will see a file my-berkshire-stylesheet.css. This is the file you will be adding your styling to.
If you look at that file, you will see there is already something there. It's set to turn the background color to red when you get the external stylesheet set up properly and open it in a browser. When you have it linked, you can promptly delete that CSS.
You'll want to add the link to the my-berkshire-stylesheet.css in the html file you just copied into this directory.
Make your site look like Berkshire Hathaway's! You may want to add classes or ids (decide which makes the most sense and why) to your HTML.
Get used to searching for how to do these things. You'll find a lot of great resources that will help you with HTML and CSS. w3schools is one good resource.
- Text: #000080 (navy)
- Links: #800080 (purple)
- Visited links : #ff0000 (red)
- background: #ffffff (white)
- Make the description text smaller and the normal font color.
- Bold the text
- Change the size
- Center the text
- Put the line breaks in (use CSS rather than HTML)
- Make the "B" and "H" larger than the other letters in "Berkshire Hathaway"
(There should be four). Do not use the <hr>
tag.
I know you've been dying to see the actual source code Berkshire Hathaway uses. Thankfully, you can see it pretty easily. Most browsers display source code when CTRL+U is pressed.
Now compare your HTML and CSS to the source. Make some notes of the differences and which site you think uses better practices. You'll need to answer some questions about this in your reflection section.
- Add a picture of Warren Buffet and position it where it makes the most sense for you
- Make the heading of the page look like a modern heading (rather than the top of a resume)
- Add a new font
Commit your changes for each file in this challenge, and push your changes to github. You do not need to be able to see your clone as a website, you should just have your code pushed to your fork of the phase-0-unit-1 repository.
Edit the my_reflection.md file associated with this challenge. Commit your changes and push them to GitHub. Check they are there!
- CSS Basics (styling)
- Mozilla's CSS - Getting Started (sections 1-6 if you're unfamiliar with CSS, sections 3-5 if you're familiar with CSS)
- Hexidecimal color
- Classes vs IDs
- The Difference between IDs and Classes
- SMACCS - CSS Design Thinking
- 30 CSS Best Practices for Beginners
- Magic of CSS