Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <!-- HTML Tags

<body></body>
- contain all of the content of your document
https://www.w3schools.com/TAgs/tag_body.asp

<header></header>
- can contain introductory information such as logos, a navigational menu or header tags (h1-h6). A page may have more than one header.
https://www.w3schools.com/TAgs/tag_header.asp

<main></main> 
- specify the main content of a page. 
- only be one per document 
- exclude headers or footers
https://www.w3schools.com/TAgs/tag_main.asp

<h1></h1>
- specifies the main header to a document
- only one per document!

<a></a>
- specifies a hyperlink (a link to another page) or an anchor
https://www.w3schools.com/TAGS/tag_a.asp

<footer></footer> 
- contain information such as contact details, copywrite details or a sitemap
https://www.w3schools.com/TAgs/tag_footer.asp

-->
<body> 
  <header>
    <!-- logos and navigation go here -->
  </header>
  
  <main>
    <h1>Sumo</h1>
  </main>
  
  <footer>
    <!-- footer info such as contact details here -->
  </footer>
  
</body>
              
            
!

CSS

              
                /* Basic CSS tips

@import
- allows you to import and use fonts from Google Fonts
- alternatively you can use a standard font that doesn't require import, such as Arial 

CSS Animation
https://www.w3schools.com/css/css3_animations.asp

@keyframes 
- allows you to change styling across a duration of time
- the animation starts at 0% and ends at 100%

selector:hover
- targets html tags in specific states
- :hover targets selector when hovered over by mouse

CSS borders
https://www.w3schools.com/css/css_border.asp

*/

@import url('https://fonts.googleapis.com/css?family=Erica+One&display=swap');

body {
  animation-name: changeBackground;
  animation-duration: 15s;
  animation-iteration-count: infinite;
  overflow: hidden;
}

@keyframes changeBackground {
  0% {
     background-image: url("https://blogs.plos.org/obesitypanacea/files/2010/08/sumo-wrestler.jpg");
  }
  25% {
    background-image: url("https://i.telegraph.co.uk/multimedia/archive/01633/sumo-wrestlers_1633119c.jpg");
  }
  50% {
     background-image: url("https://2.bp.blogspot.com/_kxPG6y8Qctk/S74ULMdh_WI/AAAAAAAAZoY/vn8zR5UY3PQ/s400/Sumo+Wrestler%27s+Photos+%2819%29.jpg");
  }
  75% {
     background-image: url("https://yourjapanese.files.wordpress.com/2011/06/artwild1x.jpg");
  }
  100% {
    background-image: url("https://blogs.plos.org/obesitypanacea/files/2010/08/sumo-wrestler.jpg");
  }
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

h1 {
  text-transform: uppercase;
  font-family: 'Erica One', sans-serif;
  color: white;
  font-size: 10vw;
  cursor: pointer;
  tab-index: 1;
  padding: 5vw;
  border-style:solid;
  border-width: 10px;
  border-color: white;
}

h1:hover {
  animation-name: growText;
  animation-duration: 4s;
  animation-iteration-count: infinite;
}

@keyframes growText {
  0% {
    font-size: 10vw;
  }
  50% {
    font-size: 20vw;
  }
  100% {
    font-size: 10vw;
  }
}
              
            
!

JS

              
                /* Resources

Colors
https://www.w3schools.com/colors/colors_names.asp
https://coolors.co/app
https://htmlcolorcodes.com/color-picker/

Fonts
https://websitesetup.org/web-safe-fonts-html-css/
https://fonts.google.com/?

*/

/* Tasks

1. Change font, color and content of the h1 'Sumo'.
2. Change the border style of the h1.
3. Change background from sumo images to different colors. You will need to use something other than 'background-image'. Can you find out what you need to reference a background color?
3. Add a tagline to your title using a <p></p> tag. Can you style it?

*/
              
            
!
999px

Console