Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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