SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru
    Join Date
    Sep 2003
    Location
    Northern California
    Posts
    605
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    embedded vs linked style sheets

    When I put the following CSS in a separate, linked style sheet, the font for<p> elements goes to Times. When embedded as shown below in the <head> section, all works fine.

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style>
    p, td, ul{font:12px/18px Verdana;color:#444;}
    ul {list-style-type:none;margin-left:0;padding-left:0;}
    li{margin:.6em 0;}
    h4{margin:0 0 5px 0;font:bold 16px Georgia;color:#9b845b;}
    .error {color:#ae3535;}
    .bios {display:block;margin:0 15px 5px 0;padding:3px;float:left; border:1px solid #bfaa7d;}
    .segno {background: #fff url(images/segno.gif) no-repeat center center;margin:15px auto;height: 40px;}
    .form {
    	border:1px solid #bfaa7d;
    	background-color:#fefefe;
    	color:#507dA7;
    	padding:2px;
    	font:12px Verdana;
    	}
    </style>
    </head>

  2. #2
    SitePoint Guru
    Join Date
    Sep 2003
    Location
    Northern California
    Posts
    605
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    for reasons that i don't understand, the problem (at least in FF) is solved by moving this rule: p, td, ul{font:12px/18px Verdana;color:#444;} to the bottom.

  3. #3
    SitePoint Member Elysa's Avatar
    Join Date
    Nov 2005
    Location
    Dallas, TX
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you are wanting all of the type that you don't specify a class to to look the same I'd recommend putting your default style in the body tag as well as the p, like

    body {font:12px/18px Verdana;color:#444;
    }


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
  •