Results 1 to 6 of 6

Thread: How to link CSS into the HTML file?

  1. #1
    Join Date
    Nov 2009
    Posts
    1,416

    How to link CSS into the HTML file?

    Hi Guys,

    I learning the web designing languages. In which I what is the use of the CSS and how to create CSS. But I am not able to link the CSS into the HTML file. Which is used for this linking?
    Please let me know how can I do for linking between CSS file and HTML file. I would great;y appreciate your help.

  2. #2
    Join Date
    May 2008
    Posts
    2,297

    Re: How to link CSS into the HTML file?

    Hi friends,

    You need to use the "Style" tag to link the CSS file into the HTML file. Please refer the below example for the CSS HTML liking:
    HTML Code:
    <html>
    <head>
    <title>CSS Linking</title>
    <style type="text/css">
    	xyz {
    		color: black;
    	}
    
    	pqr {
    		color: red;
    	}
    </style></head>

  3. #3
    Join Date
    Oct 2005
    Posts
    2,393

    Re: How to link CSS into the HTML file?

    In the HTML there is special tag available to link the CSS(Cascading style sheet) within the HTML document. Below is the syntax and the example for the "link" tag:

    Syntax:
    <link type="text/css" rel="stylesheet" href="NameOf CSS" />
    Example:
    <link type="text/css" rel="stylesheet" href="DemoCSSFile.css" />

  4. #4
    Join Date
    May 2008
    Posts
    2,389

    Re: How to link CSS into the HTML file?

    Hi,

    Below example will demonstrate you how to browse the CSS file inside the HTML file. It can be done using single link tag. See below
    <html>
    <head>
    <link href="sample.css" rel="stylesheet" type="text/css" />
    </head>
    <body bgcolor="red">
    <h5> welcome </h5>

    // body fo teh HTML page

    </body>
    </html>

  5. #5
    Join Date
    Feb 2008
    Posts
    1,852

    Re: How to link CSS into the HTML file?

    Hello,

    You have two way to achieve this task. First method is the use the "<link>" tag. The second method is to use the "<style>" tag. The syntax for the both tags are different . In the both the tag you need to provide the path of the css file that you have already created. If you are using the "<link>" tag then you need to provide the css name as value for "href" attribute.

  6. #6
    Join Date
    Jan 2008
    Posts
    1,521

    Re: How to link CSS into the HTML file?

    Please go through the below HTML code :
    HTML Code:
    <html>
    <head>
    <title>CSS program</title>
    <link type="text/css" rel="stylesheet"  href="pqr.css" />
    
    <body>
    
    <Marquee>
    
    Welcome to the CSS linking
    
    </Marquee>
    
    </body>
    
    </html>

Similar Threads

  1. How to link html form to outlook
    By Mast Maula in forum Software Development
    Replies: 6
    Last Post: 11-01-2011, 01:39 PM
  2. Changing link color when moving mouse over link in HTML
    By Cade in forum Software Development
    Replies: 5
    Last Post: 22-01-2010, 07:46 PM
  3. How to link documents in HTML
    By Saaz in forum Software Development
    Replies: 3
    Last Post: 17-11-2009, 01:40 PM
  4. Link HTML and Powerpoint
    By Connect_Me in forum Software Development
    Replies: 3
    Last Post: 07-04-2009, 11:54 PM
  5. VB6.0 link html page
    By Taipai in forum Software Development
    Replies: 3
    Last Post: 26-01-2009, 06:34 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,719,282.87354 seconds with 17 queries