Tuesday, July 15, 2014

Styles

There's three main types of styles it depends on where you declare your style information

             1-     inline styles

                          Inline styles are styles that are written directly in the tag on the document. Inline styles affect only the tag they are                                 applied to.
      <a href="" style="text-decoration: none;">
      this is just the previous example i said 

               2- Embedded styles

            styles that are embedded in the head of the document. Embedded styles affect 
                   only the tags on the  page they are embedded in.
if we want to use it we should write it inside the <head> tag
for example :
<html>
<head>
<style type="text/css">
p { color: #00f; } */ we are saying that all <p> tags should have this color
</style>
</head>
<body>
<p> hello</p> */ all the <p> tags will change its color
</body>
</html>

3-external styles

External styles are styles that are written in a separate document and then attached to various Web documents. External style sheets can affect any document they are attached to.
<link rel="stylesheet" type="text/css" href="styles.css" />
     but where we should write our style or css file then 
     go to sublime or notepad and do the following:
     1- write <style> tag 
     2- for example lets use this one :
        <style>
        p {
         padding-top: 100px; */ padding is to make space between each object in your                            webpage
          }
     3-press ctrl+s 
     4- name it as you want but now you should do it like this "your_file_name.css"
     5-its very important that the html and css file should be in the same folder or 
       in the <link> tag you must write the address of your file for example
       <link rel="stylesheet" type="text/css" href="D:\Mywebpage\styles.css">

Thats it guy if you have any question please dont hesitate to ask 







No comments:

Post a Comment