Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Re: trouble including css into the html

Reply
Thread Tools

Re: trouble including css into the html

 
 
Beauregard T. Shagnasty
Guest
Posts: n/a
 
      05-10-2010
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: trouble including css into the html Adrienne Boswell HTML 0 05-10-2010 01:52 PM
Including jsps/html files from remote host into our JSP Venkatesh Java 4 12-19-2006 11:58 PM
Trouble including Python.h Marcelo Gosling Python 5 06-24-2006 05:57 AM
confused - html validates, css validates but validate css from the html causes errors Titus A Ducksass - AKA broken-record HTML 6 11-15-2004 12:59 PM
Including HTML files within another HTML file Ralf Koms Javascript 4 10-12-2004 10:49 PM



Advertisments