Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML How to Make a Website Debugging HTML and CSS Problems Review: Debugging HTML and CSS Problems

PRATIK TALREJA
PRATIK TALREJA
1,971 Points

CSS download

Do we have to download any CSS file to style our HTML file. Or we just put the name of CSS file?

You do not need to download any CSS file to style your HTML file. You can style your HTML file in three ways:

  1. Inline - Used to add CSS styling to an element within the element’s tag in the html file

      <h1 style=”padding-left: 20px; color: blue;”>some heading</h1>
    
  2. Internal - Used to add CSS styling inside a <style> tag inside the <head> tag in the html file

    <head>
      <style>
        h1 {padding-left: 20px;}
        body {background-color: yellow;}
      </style> 
    </head>
    
  3. External - Uses a <link> tag inside the <head> tag of the html file to add an external CSS file to the html file. This is by far the best method to use because you can use the same css file linked into multiple html files for various pages of the same website. If you want to change the styling of an element, you then only have to change it in the one external css file which will then change the styling to all the html files the css is linked to rather than changing it in every html file as either internal or inline.

    <head>
      <link rel=”stylesheet” href=”styles.css”>
    </head>
    
PRATIK TALREJA
PRATIK TALREJA
1,971 Points

that was very helpful .thanks a lot