Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • What are different ways to apply CSS styles to a Web page:

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 1.78k
    Comment on it

    1. Inline css:   In inline css we can insert a ‘style’ attribute inside an HTML element. This allows CSS properties on a "per tag" basis. Below is code for inline css in our webpage.

          

      <p style=color:blue;textalign:center;float:left;width:100%;>Lorem Ipsum</p>
    
    

     


    2. Embedded/Internal css stylesheet:   When we create a stylesheet internally in the html page in which we are working, we need to use the <style></style> HTML tags in the Head section of our webpage. All the  css code for the Internal CSS stylesheet is between the <head></head> section of our websites code. Below is an example of Internal stylesheet .    

     

      <head>
          <style>
          .wrapper
          {
          float:left;
          width:100%;
          height:auto;
          backround-color:red;
          border:1px solid black;
          }
    
          </style>
      </head>
     

     

     


    3. Linked/External css stylesheet:  When we use an external stylesheet we must include the stylesheet in the HTML page in which we are working. We would add the code below to our HTML document to include a stylesheet. We will upload the "style.css" page, this file can be located anywhere in our files and folders. We can name our stylesheet according to our choice of name. Now we can link it in our head section of HTML page and every edit in our "style.css" sheet will be globally changed through out the site. Below is code to include external css stylesheet.      
     

     

     <head>
    
              <link rel="stylesheet" type="text/css" href="/support/style.css" />
    
      </head>

     

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: