SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Dec 2011
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how can use css in html ?

    how can use css in html ?

  2. #2
    #titanic {float:none} silver trophy
    molona's Avatar
    Join Date
    Feb 2005
    Location
    from Madrid to Heaven
    Posts
    8,259
    Mentioned
    245 Post(s)
    Tagged
    1 Thread(s)
    You don't use CSS in html, you use it with HTML... And this question is too broad to answer. The best way (although not the only) is to create a CSS document and link it you your html page right in the HEAD area.

    Examle: your css document is called mycss.css

    then, your code in your html page would be

    Code:
    <head>     
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" > 
        <title>Title of the Page</title>    
        <link rel="stylesheet" type="text/css" href="mycss.css">
    </head>

  3. #3
    SitePoint Member
    Join Date
    Dec 2011
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Another Two ways are:

    1. put the style tag in <head> like this:
    <head>
    <style>/*Css Contents here*/</style>
    </head>

    2. put on elements as attributes like this:
    <div style=""></div>
    <a style=""></a>
    -->This is not recommended.

  4. #4
    SitePoint Wizard bronze trophy Black Max's Avatar
    Join Date
    Apr 2007
    Posts
    4,029
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    This question is beyond basic, and has been answered. Thread closed.


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
  •