CSS: Lesson 2 - Adding CSS to an HTML file



Different ways CSS can be used.  There are three ways to add css to html.
1.       Within the tag itself,  this Is called inline CSS
An example would be if you wanted to target the body and have the background display red, then you would write it like this:   <body  style=”background-color: red”>
2.       You can display css within the <head> <style></style> </head>  this is called embedded because it is in the same file but embedded in the head tag.   You can see an in the previous lesson

3.       The third way is place all your css in a file.  You must save the file with a css extension  (e.g.  myLayout.css) .  you would use a special <link> tag to connect to the file .  we will learn more about this in later chapters.  

2 comments:

  1. Thanks For sharing this Superb article. I use this Article to show my assignment in college. it is useful For me Great Work.
    HTML basics for SEO

    ReplyDelete
  2. Nice articel, This article help me very well. Thank you. Also please check my article on my site What Is CSS?.

    ReplyDelete

TUTORIALS

  • HTML
  • CSS
  • Javascript
  • JQuery
  • PHP
  • MySQL

Labels