Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jul 2014
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to integrate a CSS into a Web pages?

    Hi guys,

    Kindly let me know, Different ways to integrate a CSS into a Web pages?

  • #2
    New to the CF scene
    Join Date
    Jul 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

    You can embed the styles in your

    <head>
    </head>

    section with the

    <style type="text/css">
    </style>

    tags, or you can create an external stylesheet and call to it from your html/php file like so,

    <link rel="stylesheet" type="text/css" href="styles.css" />

    or

    @import url(styles.css);

    So for example if you were to create styles.css and you wanted to import it into your html file it would look like this,

    <!DOCTYPE html>
    <html>
    <head>
    <title>Title of the document</title>
    <link rel="stylesheet" type="text/css" href="styles.css" />
    </head>

    <body>
    The content of the document......
    </body>

    </html>

  • #3
    New to the CF scene
    Join Date
    Jul 2014
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    <link rel="stylesheet" type="text/css" href="linktoyourstylesheet" />

    Goes before the </head> tag.

  • #4
    New to the CF scene
    Join Date
    Jul 2014
    Location
    Ahmedabad
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The 3 ways to insert CSS into your web pages:

    1. With an external file that you link to in your web page:

    <link href="myCSSfile.css" rel="stylesheet" type="text/css">

    or using the import method:

    <style type="text/css" media="all">
    @import "myCSSfile.css";
    </style>

    2. By creating a CSS block in the web page itself; typically inserted at the top of the web page in between the <head> and </head> tags:

    <head>
    <style type="text/css">
    p { padding-bottom: 12px; }
    </style>
    </head>

    3. By inserting the CSS code right on the tag itself:

    <p style="padding-bottom:12px;">Your Text</p>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •