Re: trouble including css into the html

Discussion in 'HTML' started by Beauregard T. Shagnasty, May 10, 2010.

  1. Jeff wrote:

    > Below you see the html and css of my site. The problem is that I don't
    > see any effect of the css on the layout of the page. hence the css
    > has no effect. I'm not sure what causes this., you got any
    > suggestions?


    Yes. Post a URL instead.

    > the html and css validates


    However, it is still incorrect. For some value of incorrect.

    > html:
    > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


    Why are you doing new work using Transitional? Use HTML 4.01 Strict
    instead. (Remove the extra slashes at the end of those link elements)

    > <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
    >
    > <head>
    > <title>this is the title</title>
    > <link rel="canonical" href="http://www.mysite.com" />
    > <link href="css/layout.css" rel="stylesheet" type="text/css" />
    > </head>
    >
    > <body>
    > body


    Be sure to enclose loose 'body content' in some sort of container
    element.

    <div>body</div>

    > <div id="content"> <------- an "id"
    > content
    > </div>
    > </body>
    >
    > </html>
    >
    > css:
    > body
    > {
    > margin:0px;
    > font-family:Arial, Verdana, Sans-Serif;
    > font-size:12px;
    > color:Black;
    > background-color:Yellow;
    > }
    > .content <--------- a "class" not an "id"
    > {
    > width:800px;
    > margin-left:auto;
    > margin-right:auto;
    > background-color:#ccddee;
    > }


    Change the style sheet's ".content" to "#content"
    Consider also not using fixed-pixel layout, and use percentages for font
    sizing. Sans-Serif should be sans-serif. Verdana is not recommended.

    --
    -bts
    -Four wheels carry the body; two wheels move the soul
     
    Beauregard T. Shagnasty, May 10, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Titus A Ducksass - AKA broken-record
    Replies:
    6
    Views:
    655
    Titus A Ducksass - AKA broken-record
    Nov 15, 2004
  2. Marcelo Gosling

    Trouble including Python.h

    Marcelo Gosling, Jun 23, 2006, in forum: Python
    Replies:
    5
    Views:
    402
    Tim Roberts
    Jun 24, 2006
  3. Venkatesh
    Replies:
    4
    Views:
    1,962
    Daniel Pitts
    Dec 19, 2006
  4. Adrienne Boswell

    Re: trouble including css into the html

    Adrienne Boswell, May 10, 2010, in forum: HTML
    Replies:
    0
    Views:
    425
    Adrienne Boswell
    May 10, 2010
  5. Ralf Koms
    Replies:
    4
    Views:
    147
    Ralf Koms
    Oct 12, 2004
Loading...

Share This Page